TL;DR

On 18 November 2026 my Mac was infected by PolinRider, a worm that hides inside the config files of JavaScript projects and spreads through git. We had been fighting it for months without knowing what it was. This week we traced it, cleaned my machine and our repositories, and found it was still hiding on old branches and tags in three repos after we thought we were done.

To stop it happening again, we built repo-guard, a free, open-source tool that checks every repo before any of its code can run. It has already found and cleaned the malware on a teammate's machine.

What you should do: install repo-guard and scan the folder where you keep your repos. It takes two minutes:

pipx install git-repo-guard repo-guard setup repo-guard scan-all ~/Dev 

How I got hacked

The worm runs the moment you open an infected project in your editor, or run npm run dev, build or lint in it. Nothing looks wrong: the project starts as usual, and the malware runs quietly in the background.

Open question for me to fill in: which repo or download brought it onto my machine, and when I first noticed something was off.

Once it runs, PolinRider does three things:

  1. Steals. It goes after tokens and credentials on the machine: GitHub, npm, cloud and SSH keys, and crypto wallets.
  2. Spreads. Using those stolen tokens, it rewrites commits in every repo the victim can push to and force-pushes them. Anyone who pulls or clones those repos gets infected next.
  3. Hides. It puts its code where people don't look: off-screen in config files, on side branches, and in old tags.

That is why cleaning one machine was never enough: the infection also lived in the repos themselves, ready for the next person who pulled or cloned them.

PolinRider has been found alongside the tooling of Contagious Interview, a long-running, North Korea-linked campaign. It targets developers with fake job interviews and take-home coding tests that carry malware, and its goal is money: credentials, tokens and crypto.

How we traced it

The worm is hard to see because every piece of it hides somewhere a developer never looks. Once we knew the hiding places, we could find it every time.

Where it hides What we found Why nobody noticed
Config files (eslint.config.js, vite.config.mjs, postcss.config.mjs, Tailwind and Astro configs) Normal-looking code, then hundreds of spaces, then the payload on the same line Editors and diffs cut the line off, so the code sits off-screen
package.json scripts node init && added to the start of dev, build or lint It still runs your real command afterwards
.vscode/tasks.json A task set to run when the folder opens VS Code runs it before you touch anything
Font files (.woff2) JavaScript saved with a font extension Nobody opens font files
.gitignore New lines like temp_auto_push.bat and branch_structure.json; the .env and .vscode lines removed It hides the worm's own files and exposes yours
Git history Existing commits rewritten and force-pushed, often onto side branches and old tags The commit messages and authors look the same

Two signals in git gave the rewritten commits away. First, the committer date didn't match the author date: the worm re-commits old work, so the commit says it was written months ago but committed this week. Second, git's local records of what we fetched showed force-pushes on main in four of our repos.

The payload itself contains a recognisable signature (rmcej%otb%), the same signature other researchers' PolinRider scanners look for.

How we cleaned up

We cleaned up in two rounds, and the second round is the one that matters.

Round 1: the machine and the main branches. We removed the hidden payloads, the init dropper files, the node init && script prefixes and the auto-run VS Code tasks, and restored the .gitignore lines the worm had deleted. The default branches scanned clean, and we thought we were done.

Round 2: the leftovers. Once repo-guard could scan every branch and tag, not just the checked-out one, it found the worm still alive in three repos:

Repo Where the worm was still hiding
billboxx-web-app Payload in vite.config.mjs on the dev and feat/kyc branches, plus a committed Sentry token file
billwebb Payload in eslint.config.js on two feature branches
mac-pause Payload in the website's Astro config on the v1.0.0 tag, and worm .gitignore lines on main

Anyone who checked out one of those branches, or built that tag, would have been infected again.

The fix turned out to be simpler than we feared. The worm doesn't add new commits: it rewrites your existing ones and keeps the original message and author date. So for each branch we found the original, clean version of every rewritten commit and put the branch back on it. Nobody's work was lost. billwebb's main, for example, is still release v2.7.0, and dev still has the latest fixes; the only things removed are the worm's dropper, script changes, payload and .gitignore edits.

Before moving anything we saved a backup of every branch and tag, and each force-push was approved one at a time.

Two things remain for every team that goes through this:

  • [ ] Rotate credentials. Anything the infected machine could reach may be stolen: GitHub, npm, cloud, SSH keys, and the committed Sentry token.
  • [ ] Re-clone. Delete old local copies of the cleaned repos and clone them again, so an infected copy can't push the worm back.

What we built: repo-guard

Cleaning up by hand taught us one rule: check the code before it can run, not after. Antivirus isn't built for this, because nothing here looks like a classic virus: it's ordinary JavaScript hidden where people don't look. So we built repo-guard, a scanner that knows PolinRider's hiding places and checks them everywhere code can arrive.

  • Every clone, from any app. After repo-guard setup, every clone is scanned, whether it comes from the terminal, VS Code, GitHub Desktop or JetBrains. If a clone is infected, its files are removed straight away, before you can open the folder.
  • Every branch and tag. It reads git's history directly, so it finds payloads on side branches and old tags too, the exact places that caught us out.
  • Before you even clone. repo-guard check owner/repo scans a GitHub repo without downloading it with git.
  • On pull and on commit. It warns when a pull brings in infected files, and refuses commits that add them.
  • Cleanup help. repo-guard clean shows you the exact fix as a diff and applies it only when you say yes.

It also looks for the wider family of tricks these campaigns use: credential and crypto-wallet theft, download-and-run code, reverse shells, hidden characters, and committed secrets and .env files.

repo-guard is free and open source (MIT), has no dependencies, and never runs any code from the repos it scans. Source and full documentation: github.com/gloverola/repo-guard.

Install, set up and use repo-guard

You need git and Python 3.8 or newer (on a Mac, Python comes with the developer tools: xcode-select --install).

1. Install it

pipx install git-repo-guard 

No pipx? Use brew install pipx first, or install with Homebrew directly: brew install gloverola/tap/repo-guard. Homebrew can sit silently for a few minutes while it updates itself; that's normal.

2. Turn on automatic protection

repo-guard setup repo-guard selftest 

setup makes every future clone get scanned automatically. selftest proves it works on your machine: every line should say PASS.

3. Scan the repos you already have

repo-guard scan-all ~/Dev 

Replace ~/Dev with the folder where you keep your repos. It lists only the repos with problems, then a one-line summary. A progress line shows what it's doing while it works.

Everyday commands

Command Use it to
repo-guard scan . Check the repo you're in: files, every branch and tag, and git settings
repo-guard scan-all ~/Dev Check every repo in a folder
repo-guard check owner/repo Check a GitHub repo before you clone it
repo-guard clone URL Clone safely: nothing is written to disk until every branch scans clean
repo-guard clean . Get a proposed fix for an infected repo, shown as a diff
repo-guard rules See everything it looks for
repo-guard uninstall Remove repo-guard completely

After setup, plain git clone is protected too, so you don't need to change how you work. To upgrade later: pipx upgrade git-repo-guard.

If repo-guard finds something

Every finding is marked HIGH, MEDIUM or INFO. HIGH and MEDIUM mean stop; INFO is just for your awareness.

  1. Don't open the repo in your editor, and don't run npm install, npm run dev, build, lint or tests in it. Those are exactly the moments the worm runs.
  2. Share the output with the team. Don't try to fix and push on your own: if an infected copy is still out there, the next force-push undoes your fix.
  3. Clean together. repo-guard clean fixes the files on disk; branches and tags are put back on their clean commits as described above.
  4. Rotate your credentials from a clean device if the repo was ever opened or run on your machine.

Also check two editor settings. In VS Code, Cursor and similar editors, set "task.allowAutomaticTasks": "off" and keep Workspace Trust on, so a repo can't run tasks the moment you open it.

Lessons learned

Until this week we were reactive: clean what we can see, then wait for the next infection. From now on we check first.

  • A clean main doesn't mean a clean repo. The worm survived on side branches and an old tag. Scan every branch and tag, not just the one you have checked out.
  • Opening a folder can run code. Editor tasks, npm scripts and config files all execute. Treat a new or unfamiliar repo as untrusted until it has been scanned.
  • Look where people don't. Off-screen code, font files and .gitignore edits all slipped past code review. A tool has to read every byte, because a person won't.
  • Force-pushes are an alarm. An unexpected force-push to main should be investigated, not ignored. Branch protection now blocks force-pushes on repo-guard's own main, and we should turn it on for ours.
  • Assume credentials are gone. If malware ran on a machine, everything that machine could reach needs a new key.

The new habit is simple: install repo-guard once, run repo-guard setup, and scan your repos folder. After that, every clone is checked for you.