Skip to content
Shipworthy

PolinRider: the GitHub worm that forges your commits

PolinRider rewrites developers' own GitHub commits to hide a loader that runs on build, test or VS Code folder open. How to check your repos and what to rotate.

By · · 13 min read

Diagram of how PolinRider works: an infected developer machine force-pushes a forged copy of an old commit with a loader hidden after hundreds of spaces in a build config; building, testing or opening the folder in VS Code runs it; the loader reads its server address from an Ethereum transaction.

If you or anyone with push access to your GitHub repositories might have run a stranger's code in the last year, check those repositories for PolinRider. It is a North Korea–linked malware campaign that uses stolen GitHub access to rewrite commits a developer already made. The author, message and date stay the same. The only addition is a loader, hidden after hundreds of spaces at the end of a line in a build config, a Python module or a VS Code task. Anyone who later builds, tests or, in the newest wave, just opens that folder in VS Code runs it.

Apiiro counted at least 7,609 infected repositories across 2,330 accounts in October. In the last week SafeDep found new Python and TypeScript versions of the loader, and StepSecurity showed a single account forcing it into pull requests at AsyncAPI, CircuitVerse and Open Food Facts. At CircuitVerse it ran inside a release build.

Why it is in the news now, and what is actually new

Much of the coverage this week presents the 7,609 figure as fresh. It is not. Apiiro published it on 9 November, from scans of 17 and 28 October. OpenSourceMalware has tracked the campaign since March, when it counted 675 repositories. Three things are new this week:

  • 24 November, updated 28 November: Python and TypeScript loaders. SafeDep found a 58-line Python loader in 375 public repositories under 260 accounts, and a TypeScript version in 528 repositories under 322 accounts. "No package on PyPI or npm carries it," SafeDep says. The infection lives in the repositories themselves.
  • 25 to 27 November: malware in other people's pull requests. An account called Eternity0207 had opened 217 pull requests across open-source projects, and 145 were merged. StepSecurity says the account force-pushed the loader into open pull requests at AsyncAPI, CircuitVerse and Open Food Facts, and Jaeger later found it on three pull-request branches too. GitHub suspended the account and removed all its pull requests on 25 November. According to StepSecurity, none of the 145 merged pull requests contains the loader. The maintainers checked.
  • The servers are still being rotated. StepSecurity says the wallet behind the newest wave posted a new server address on 25 November and was "still posting it about every 3 hours 20 minutes on November 27."

How it works

Your own commit, rewritten

This is the part that makes PolinRider different from a typosquatted package. In Apiiro's words: "The worm uses stolen GitHub access to rewrite commits the developer already made, keeping the author, message and date, and adds a loader hidden after hundreds of spaces in a build config."

Apiiro used GitHub's activity log, which records every force-push along with the commit it replaced, to measure this:

  • "In 4,402 of 4,460 injection pushes we could resolve, across 2,975 repos, the worm swapped a clean commit for a copy with the same author, message and timestamps to the second, plus the loader."
  • "In 94% of 9,990 injection pushes, it claims to be more than an hour older than the push that delivered it."
  • "In 628 repos the replaced commit was a merge GitHub itself had signed; the copy is unsigned, so it was built off GitHub."

So a developer reading git log sees an old commit under their own name, and the loader sits past the right edge of the screen. OpenSourceMalware says infected machines leave a fingerprint in .gitignore: entries such as config.bat, temp_auto_push.bat and branch_structure.json, the working files of the auto-push tool, which are never committed themselves.

Where the loader hides

The sources list the same places again and again:

  • JavaScript and TypeScript build configs, with the loader appended after hundreds of spaces or tabs: tailwind.config.js, postcss.config.mjs, eslint.config.mjs, next.config.*, vite.config.*, webpack.config.js, babel.config.js, jest.config.js and others.
  • package.json scripts prefixed with node init && or node api.js &&, pointing at a new file in the repository root.
  • .vscode/tasks.json with a hidden task set to "runOn": "folderOpen" that runs node on a fake font file under fonts/. OpenSourceMalware found a matching .vscode/settings.json that turns on automatic tasks and hides the terminal.
  • Fake fonts such as fa-solid-400.woff2, fa-solid.lkf or fa-brand-400.orc that are really JavaScript.
  • Python, the new wave: a loader in a utils package (session.py, net.py, clients.py, transport.py, http_session.py) or in conftest.py, plus a few planted import lines in an entry file. SafeDep notes that it "uses only the standard library", so "a scan of requirements.txt or a lockfile does not show it."

What runs it

Apiiro is precise about this: "Cloning runs nothing. npm run dev, build or lint loads the config, so whoever builds an infected checkout runs it: the owner, CI, a fork, or an agent." And: "In the newest wave, opening the folder in VS Code is enough."

For the Python variant, SafeDep says pytest runs the loader through conftest.py, and the planted imports run it when the application starts.

StepSecurity points out one thing that will catch people out: none of these routes uses an npm install script, "so blocking preinstall and postinstall scripts does not stop them."

Why taking down the server does not help

The loader does not carry a server address. It reads the latest transaction from a fixed Ethereum wallet, and the address is encoded in that transaction. Apiiro: "taking a server down changes nothing: one transaction moves every loader to the next." The Python loader looks the wallet up through the public Ethplorer and PublicNode services, then hands the next stage to a detached node process that keeps running after the loader exits.

What it does once it runs

Nobody has published a capture of the live November payload. Apiiro decoded an earlier second stage from the BNB Chain and described it as a remote-access tool. To The Hacker News, Apiiro's Shmulik Cohen called the current payload "most likely that script". By his and Apiiro's account, it skips CI machines, runs the operator's commands, reads the clipboard, uploads files and plants itself in VS Code, Cursor, Discord and GitHub Desktop. Abnormal AI reports that it also tampers with npm's own CLI, and that a Python stealer goes after browsers, crypto wallets, password managers, .git-credentials and .env files.

That is how it spreads: a machine that runs the loader can be robbed of its GitHub access, and that access is then used to forge commits in the next set of repositories.

Who is affected

The obvious victims are developers whose machines were infected. Apiiro says most are not throwaway accounts: 86% of the infected repositories "belong to personal accounts more than a year old with five or more repos and real activity", and "Only 16 owners look like throwaways." Named victims include Neutralinojs, InstaWP Connect and fxhash.

The wider exposure is anyone who builds someone else's code:

  • CI. At CircuitVerse, StepSecurity says the loader ran in the release workflow that builds the desktop app. The maintainers deleted the 40 installers it had published and merged a fix on 26 November so that fork pull requests no longer publish builds. Open Food Facts' CI also ran the poisoned commits, and its maintainers rotated a secret. AsyncAPI's CI did not run them, because workflows from fork pull requests there need a maintainer's approval.
  • Coding agents. Apiiro counted 293 infected repositories with coding-agent configuration, and "agents routinely run dev, build and lint, which load the infected file."
  • npm users, a little. Apiiro found two infected repositories whose own release pipelines shipped the loader to npm. Their infected packages had 84 weekly downloads between them.

On fork pull requests, StepSecurity notes that GitHub passes no repository secrets and gives GITHUB_TOKEN read access only, "and no project has reported stolen secrets." The code still ran and could still reach the internet.

How to check your repositories

Check every branch, not only the default one. Apiiro's counts cover default branches only. In one case OpenSourceMalware watched an account force-push a new variant "to every branch of all three repos" in about eight minutes, and in another it counted 853 force-pushes, 814 of which rewrote only the tip commit.

1. Look for the padding. Apiiro's search, run inside a clone, covers all local and remote branches:

git grep -nE ';[[:blank:]]{200,}[^[:space:]]' \
  $(git for-each-ref --format='%(refname)' refs/heads refs/remotes) \
  -- '*.js' '*.mjs' '*.cjs' '*.ts' init

Run git fetch --all first so the remote branches are current. A hit is a line that ends in a semicolon, then 200 or more spaces or tabs, then more code.

2. Look at .vscode/ and package.json. OpenSourceMalware's checks:

grep -rl --include=tasks.json '"runOn": "folderOpen"' .
find . -path '*/fonts/*' -type f ! -name '*.svg' ! -name '*.md' -exec file {} + | grep -i text

The second command lists "font" files that are really text. Also read your package.json scripts for a node init && or node api.js && prefix, and check any committed .env for an AUTH_API_KEY value that decodes from base64 to a URL. Apiiro found that trick too.

3. Python projects. From SafeDep:

grep -rniE '0x3b1574417524c11a7403c4b232cacbb320ccebc6|getAddressTransactions|eth_getTransactionByHash' --include='*.py' .
find . -name conftest.py -exec grep -l 'NamedTemporaryFile' {} +

SafeDep's post has more checks, including one for the planted import utils.… lines. That one will also match a project's own legitimate utils package, so read any hit before you panic.

4. Read GitHub's push log, not git log. Apiiro's advice is blunt: "Don't trust git log." List force-pushes with GitHub's repository activity API (gh api works too, with your token):

curl -s "https://api.github.com/repos/OWNER/REPO/activity?activity_type=force_push&per_page=100"

A force-push whose commit claims to be days or weeks older than the push itself is the signature. Apiiro also suggests reading the diff of any force-push to your own repositories, not just its commit message.

5. Check your machine. Several sources suggest looking for node -i or node -e processes running with no terminal, and for Node processes that call Ethereum RPC services and then a raw IP address on port 443. The researchers' posts list the wallets and current server addresses. The servers rotate, so use the wallet addresses as the stable indicator.

One caution from a victim's report in OpenSourceMalware's repository: "A green CI run is not evidence of a clean tree." The dropper ran on every push while CI stayed green.

If you find it

  1. Treat the machine as compromised, not just the repository. Apiiro: "Removing the code does not revoke the access that pushed it." The Cloud Security Alliance recommends "reimaging such machines rather than attempting to clean them."
  2. Rotate from a different, clean machine. That means GitHub tokens and SSH keys, npm tokens, gh CLI logins, CI secrets, cloud keys and anything in .env files, browser-saved passwords and sessions, and crypto wallets on the machine. StepSecurity and the CSA both say to rotate from a clean host, because rotating from the infected one hands the new credentials over too.
  3. Check what the stolen access could reach. Apiiro's list: deploy keys, Actions secrets, CI runs and releases since the infection. Apiiro also advises: "Treat a cleaned repo as compromised until its tokens are rotated, and require review before anything publishes."
  4. Then clean the history. Removing the code in a new commit leaves the loader on old branches. The victim report in OpenSourceMalware's repository adds a detail I had not seen before: refs for closed pull requests (refs/pull/*) keep serving the old commits, cannot be changed by the owner, and need a GitHub Support ticket to clear.

Expect reinfection if you skip step 1 or 2. Apiiro found that 1,949 repositories "were infected again after they were publicly listed", and that the worm pushed the loader back into 9 of 16 repositories that had a "remove PolinRider" commit.

What to change even if you are clean

  • Open code you did not write in VS Code's Restricted Mode. Apiiro: Restricted Mode "doesn't run automatic tasks." Treat a committed .vscode/ folder that allows automatic tasks as a red flag.
  • Require approval before workflows run on fork pull requests. StepSecurity says the setting is "Require approval for all external contributors", and that it is what kept the payload out of AsyncAPI's CI. It adds that the first-time-contributor options would not have stopped this account. Do not publish build artifacts from fork pull requests.
  • Block force-pushes and require signed commits on branches that matter. OpenSourceMalware calls signed commits "a tripwire, not a guarantee". The worm's copies are unsigned, so a sudden unsigned commit on a branch that used to be signed stands out.
  • Block public blockchain RPC services from CI runners and build containers, unless you actually build blockchain software. Apiiro: "they rarely need Ethereum, BSC, TRON or Aptos."
  • Treat build configs, conftest.py and .vscode/ as code that runs, and review changes to them as such.

Who is behind it

Every research team links it to North Korea, with different levels of confidence:

  • Apiiro calls it "North Korea-linked" and ties one of its tricks to North Korea's fake job interview repositories.
  • The Hacker News reports that PolinRider "is assessed to be a sub-cluster operating in parallel with a long-running campaign codenamed Contagious Interview."
  • Abnormal AI states "moderate confidence" in a North Korea and Contagious Interview link.
  • The Cloud Security Alliance calls it a "well-supported assessment rather than a confirmed government finding."

The infections link back to fake job lures. StepSecurity says the wallet behind the pull-request wave is the "HuntRole fake recruiter's" wallet, and that "the fake interviews and these repository infections share an operator."

How each victim's machine was first compromised has not been confirmed. Fake coding assignments are the documented route for some victims. OpenSourceMalware says early waves reused credentials stolen by an earlier campaign it calls TasksJacker.

What is still unknown

  • What the live payload does today. No researcher has published a capture of the November second stage. The remote-access description comes from an earlier copy.
  • How many infected repositories actually ran the loader, and how much was stolen. Abnormal AI, which captured the stealer's responses, notes that the deleted staging files it found "do not prove that the data reached the operator."
  • What GitHub is doing. Apiiro says it offered GitHub the full list of infected repositories on 15 October and reported more on 28 October. Apart from suspending Eternity0207, I found no GitHub statement and no sign of a bulk cleanup.
  • The true size. The counts measure different things. Apiiro has 7,609 repositories on default branches. SafeDep has 375 Python and 528 TypeScript repositories. StepSecurity has 576 repositories reading one wallet. Apiiro says "every number is a lower bound."

I will update this post when GitHub says what it has done about the infected repositories, or when a researcher publishes a capture of the live payload.

The short version

  • PolinRider forges copies of your own past GitHub commits with a loader added after hundreds of spaces, using stolen access from an infected machine. Apiiro counted 7,609 repositories in October, and new Python and TypeScript waves appeared in late November.
  • Cloning is safe. Building, testing or opening the folder in VS Code with automatic tasks allowed is not. Blocking npm install scripts does not help.
  • Check every branch for a semicolon followed by 200+ spaces, folderOpen tasks, fake font files, node init && scripts and Python utils loaders. Then read GitHub's force-push log, not git log.
  • If you find it: reimage or clean the machine, rotate every credential from a different machine, check Actions secrets and releases, then clean all branches.
  • Everyone: use Restricted Mode for unfamiliar code, require approval for fork pull request workflows, and block force-pushes on important branches.

Frequently asked questions

What is PolinRider?

PolinRider is a malware campaign linked to North Korea that spreads through developers' GitHub repositories. From an infected machine it rewrites commits the developer already made, keeping the author, message and date, and adds a loader hidden after hundreds of spaces in a build config, a Python module or a VS Code task. Apiiro counted at least 7,609 infected repositories across 2,330 accounts in October.

Does cloning an infected repository run PolinRider?

No. Apiiro says cloning runs nothing. The loader runs when something loads the infected file: npm run dev, build or lint for the JavaScript configs, pytest or an import for the Python variant, and in the newest wave simply opening the folder in VS Code with automatic tasks allowed.

How do I check whether my GitHub repositories are infected?

Search every branch, not just the default one, for a semicolon followed by hundreds of spaces or tabs in JavaScript and TypeScript files, look in .vscode/tasks.json for a folderOpen task that runs node on a file under fonts/, check package.json scripts for a node init && or node api.js && prefix, and list force-pushes with GitHub's repository activity API. Researchers advise trusting GitHub's push times over commit dates, because the forged commits are backdated.

Is deleting the malicious code enough?

No. Apiiro says removing the code does not revoke the access that pushed it, and 1,949 repositories were infected again after being publicly listed. Clean or reimage the machine, then rotate GitHub, npm, SSH and cloud credentials from a different, clean machine, and check deploy keys, Actions secrets, CI runs and releases.

Get The Shipping Forecast

One email on Thursdays: what I tested and wrote that week, plus one tool worth your time.

You'll get a confirmation email first. Unsubscribe in one click. Privacy policy.