⚠️

سلب مسئولیت و اخلاق حرفه‌ای

این مطالب صرفاً برای اهداف آموزشی، پژوهشی و افزایش آگاهی امنیتی ارائه شده‌اند. هرگونه استفاده غیرمجاز، غیرقانونی یا سوءاستفاده از اطلاعات، ابزارها و روش‌های مطرح‌شده، کاملاً بر عهده مخاطب است. نویسنده و منتشرکننده هیچ مسئولیتی در قبال خسارات، آسیب‌ها یا پیامدهای ناشی از استفاده نادرست از این مطالب نخواهند داشت.

PolinRider: North Korea-Linked Actors Poison 7,600+ GitHub Repositories with a Python Loader | Alireza Bolbolabadi - Red Team Security
LOADING

PolinRider: North Korea-Linked Actors Poison 7,600+ GitHub Repositories with a Python Loader

What happened

A North Korea-linked threat campaign dubbed PolinRider has been planting a malicious Python loader inside more than 7,600 GitHub repositories, according to The Hacker News, drawing on analysis from SafeDep. The source page is dated 2026-11-26, and the reporting suggests the activity may have begun as early as February 2025 — a window that matters for anyone auditing repository history this year.

This is not a vulnerability in a single product with a CVE identifier. It is a repository-poisoning operation against the Python source-code supply chain, and the exploitable surface is the trust relationship between developers, their automation, and the code they import.

How the loader is hidden

SafeDep's report describes two concealment locations:

  • A small utils package, where malicious logic can blend in with expected helper functions.

  • conftest.py, the pytest configuration and collection hook that is loaded automatically when a test suite runs.

The second location is the more consequential one. Because pytest loads conftest.py implicitly, a poisoned test configuration can execute in a CI runner even when the application itself is never deployed. Import-time execution means no suspicious command needs to be typed, no payload needs to be clicked, and no macro needs to be enabled.

What the loader does

The available description states that the loader reads the newest transaction when the imported file is loaded. That pattern is consistent with staged or transaction-driven retrieval, where the implant fetches instructions or a second-stage artifact at run time rather than embedding everything in the committed source.

What the truncated reporting does not provide is equally important:

  • The source from which the transaction is read.

  • The protocol, authentication scheme, and transport.

  • Whether the retrieved content is code, configuration, or tasking.

  • The final payload and its objectives.

  • How initial commit or maintainer privileges were obtained.

Any claim about specific malware families, C2 infrastructure, or exfiltrated data in this campaign would go beyond the available evidence.

Why the blast radius is wide

Repository poisoning reaches two distinct populations at once: the humans who maintain the project, and the automation that consumes it. A poisoned commit can execute on a maintainer's laptop, on a CI/CD worker, and on downstream systems that install packages produced from that repository.

Plausible consequences include:

  • Theft of credentials, tokens, secrets, source code, and configuration reachable from the build or test environment.

  • Tampering with build artifacts, generated packages, or test outcomes before publication.

  • Delivery of follow-on malware into CI workers, developer workstations, and downstream consumers.

  • Persistence, if malicious changes are merged, tagged, and shipped in a release.

  • Propagation to repositories and users downstream of the affected projects.

The mechanism is important because it collapses the usual social engineering step. The trust anchor is not a message in an inbox; it is pip install, pytest, and a green build.

What is confirmed and what is not

Confirmed by the supplied intelligence: the campaign identity, the affected asset count of more than 7,600 repositories, the two concealment locations, the import-time trigger, and a possible February 2025 start date.

Not confirmed: that all listed repositories were successfully infected, that importers executed the payload, that credentials or systems were actually compromised, and the payload's ultimate behaviour. The number of affected repositories is a measure of attempted or observed poisoning, not a verified count of breached build systems.

There is also no linked vulnerability record. Severity here cannot be expressed as a CVE-based score; it has to be assessed from exploitability, affected surface, and observed threat activity — and on those axes, the scale of the targeting is striking even though the technical detail is thin.

Why SHA pinning alone does not close this gap

The wider industry conversation around GitHub Actions security — including material published alongside the same source page — argues that pinning alone is insufficient. That observation generalizes cleanly to PolinRider. Pinning a commit hash answers the question did the code change? It does not answer was the commit ever trustworthy? A poisoned repository, committed by an actor holding legitimate maintainer rights, produces a perfectly consistent, correctly pinned, and entirely malicious artifact.

Detection and response considerations

Because the payload executes at import time and appears to consult a remote transaction source, repository-side review and runtime observation are both necessary. Concretely, useful hunting angles include:

  • Recent commit and pull request history touching a small utils package or conftest.py, including changes that were later reverted.

  • Loader behaviour such as network access during test collection or package build, which is anomalous in that context.

  • Publishing records and CI logs showing unexpected releases, new artifacts, or outbound connections from runners.

  • Secrets exposure in any environment that imported or tested an affected repository: CI/CD tokens, package-publishing tokens, cloud credentials, signing keys, developer credentials.

  • Branches and forks, since checking only the default branch can miss removed or staged variants.

Responses should focus on cleaning the poisoned code, treating artifacts built during the exposure window as untrusted, and rotating secrets for environments that ran the affected code.

Broader context

PolinRider fits a broader pattern of attacks on open-source build pipelines rather than on running software. The target is the developer, the test harness, and the release pipeline — components that are frequently granted broad credentials precisely because they are trusted. As long as build infrastructure holds high-value secrets and executes repository content by default, campaign operators retain a viable class of attack that scales to thousands of projects in a single sweep.

منابع

·
← اخبار