Subscribe
0%
Illustration for: PolinRider malware now hides in Python repos on GitHub and runs when you start the app or pytest. How to check yours

PolinRider malware now hides in Python repos on GitHub and runs when you start the app or pytest. How to check yours

SafeDep found a 58-line Python loader planted in 375 public GitHub repos that pulls its next stage from an Ethereum transaction and runs it with Node.js. It is the latest turn of PolinRider, a repo-poisoning campaign The Hacker News links to North Korea and Apiiro counts in more than 7,600 repos. Anyone who cloned and ran an affected project should treat that machine as compromised.

Listen to this article0:00 / 5:07

The PolinRider campaign, which has spent months planting malicious JavaScript in GitHub repositories, has moved into Python. Software supply-chain firm SafeDep reported on November 24 that it found the same small Python loader in 375 public repositories belonging to 260 GitHub accounts. The loader reads an Ethereum transaction, decodes JavaScript hidden in it, and runs that code with Node.js — so it fires on a developer's machine the moment they start the app or run pytest.

Why it matters: the loader adds no dependencies, needs no package install, and sits in ordinary-looking files such as utils/session.py or conftest.py. Nothing on PyPI or npm carries it, SafeDep says, so dependency scanners won't catch it. The danger is in cloning a repo — a job-interview take-home, an open-source fork, a colleague's project — and running it.

How big is it?

The numbers in headlines measure different things:

Figure What it counts Source
375 repos / 260 accounts Repos with the new Python loader, found by GitHub code search on Nov 24; 370 were pushed to in November SafeDep
7,609+ repos / 2,330 accounts PolinRider-infected repos across all variants Apiiro, via The Hacker News
2,040 repos Pushed between Oct 27 and Nov 6 Apiiro, via The Hacker News

SafeDep calls its count a snapshot rather than a complete list. The affected repos are mostly small — together they have 189 stars, per SafeDep.

How the loader works

According to SafeDep's analysis:

  • Where it hides: 363 of the 375 copies sit in a planted package (usually a utils folder) under names like session.py, transport.py, clients.py, http_session.py or net.py; five import lines are added to the app's start file, such as a Django asgi.py or FastAPI main.py. The other 12 are conftest.py files, which pytest loads automatically.
  • What it does: it asks the Ethplorer API for the newest transaction sent by a specific Ethereum wallet, fetches that transaction from a public node, hex-decodes its data field into JavaScript, writes it to a temp file and runs it with node — errors suppressed, 20-second timeout.
  • What comes next: that JavaScript reads a second wallet whose transactions encode the current command-and-control server's IP address, then pulls further code over plain HTTP on port 443 and runs it in a detached, windowless node -i process. SafeDep did not connect to the server, so it doesn't know what the final stage does in this wave. Earlier PolinRider chains installed stealers that went after environment secrets, browser passwords, cookies and crypto wallets, it says.
  • Commit dates lie. Some planted commits are back-dated to 2025; SafeDep says the dates are not evidence of when the code arrived.

Using a blockchain as a dead drop means the attacker can swap the payload by sending a new transaction, without touching any of the infected repos.

Who is behind it

SafeDep's write-up doesn't name an actor. The Hacker News, citing researchers at OpenSourceMalware, links PolinRider to North Korean threat actors as a cluster operating alongside the "Contagious Interview" fake-recruitment campaigns, and traces related blockchain activity back to February 2025. It also reports that the same operator wallet served npm packages and a fake-recruitment VS Code extension, and that one GitHub account opened more than 200 pull requests against projects including AsyncAPI Generator, CircuitVerse and Open Food Facts before it was suspended. abit.ee repeats that framing. SafeDep separately documents two poisoned pull requests to asyncapi/generator, which a maintainer closed on November 24 without merging.

What to check

SafeDep publishes these checks; run them in any Python repo you didn't write yourself:

# the dead-drop wallet or the Ethereum calls
grep -rniE '0x3b1574417524c11a7403c4b232CAcBb320CceBC6|getAddressTransactions|eth_getTransactionByHash' --include='*.py' .

# planted utils imports (review by hand; a real utils package will match too)
grep -rnE '^import utils\.(net|clients|http_session|transport|session)\b' --include='*.py' .

# conftest.py files that write temp files
find . -name conftest.py -exec grep -l 'NamedTemporaryFile' {} +

# was it ever in history?
git log --all --oneline -S 0x3b1574417524c11a7403c4b232CAcBb320CceBC6

Other signs SafeDep lists: node -i or node -e processes with no terminal, and connections to 95.135.181.84 (current since November 12) or 95.135.181.151 on ports 80 or 443.

If you ran it

SafeDep's advice: treat any machine that ran pytest or the app with the loader present as compromised. Rotate the secrets in that shell's environment, browser passwords and session cookies; move funds out of any wallet extensions or wallet files; remove the planted package, import lines and conftest.py; clean every machine that pushes to the repo; and replace GitHub tokens and SSH keys. One affected project's own cleanup commit, cited by SafeDep, describes the malware as arriving through forced pushes.

For maintainers: review force-pushes and unexpected commits that add a utils package or touch conftest.py, jest.config.js or package.json build scripts. For everyone else, run unfamiliar repos — especially recruiter take-home tests — in a throwaway VM or container with no credentials in it.

Sources

  1. SafeDep — PolinRider Moves to Python with an Ethereum Calldata Loader safedep.io
  2. The Hacker News — North Korea-Linked PolinRider Poisons Over 7,600 GitHub Repositories to Spread Malware thehackernews.com
  3. abit.ee — PolinRider: North Korea-Linked Worm Turns GitHub Repositories into Malware Dispensers abit.ee

#PolinRider#SafeDep#GitHub#supply chain#Python#Ethereum#EtherHiding#North Korea#malware