Supply Chain Risks in GitHub and npm Package Ecosystems
Supply Chain Risk · 2 sources · Updated 5mo ago · First seen Dec 17, 2025

Recent analysis has revealed a critical security flaw in how package managers such as npm, Bun, and PyPI handle dependencies sourced directly from GitHub repositories. When specifying a dependency using a commit SHA, if that SHA exists in a forked repository, the package manager may pull code from the fork rather than the intended source, allowing attackers to inject malicious code by manipulating forks. This vulnerability is exacerbated by the lack of visibility into GitHub's internal network of forks, making it difficult for security tools and registries to detect or warn about such attacks, as demonstrated by incidents involving actors like Shai Hulud.
In parallel, AWS Security has reported on their response to recent large-scale npm supply chain threat campaigns, including the Nx package compromise, the Shai-Hulud worm, and a token-farming campaign that resulted in over 150,000 malicious packages being identified. These incidents highlight the growing sophistication and scale of attacks targeting open-source software supply chains, and underscore the need for improved detection, response workflows, and collaboration across the security community to mitigate these evolving threats.
Why it matters
Impact assessment
A broad set of software producers and consumers are affected wherever dependencies are installed directly from GitHub repositories by commit SHA, especially in npm, Bun, and PyPI workflows. The impact ranges from silent malicious code inclusion in build pipelines to credential theft and downstream software supply chain compromise, with exposure spanning both targeted attacks and large-scale ecosystem abuse.
Supporting details:
- Affected populations:
- Developers and CI/CD systems consuming GitHub-sourced dependencies by repository plus commit SHA
- Organizations using npm, Bun, or PyPI packages that resolve code from GitHub archives
- Enterprises relying on popular open-source developer tooling such as Nx
- Cloud-centric development environments where npm, GitHub, and cloud credentials are present on build hosts
- Severity:
- Malicious code can be introduced into builds without the dependency actually existing in the intended upstream repository
- Observed campaigns targeted credential harvesting, including npm tokens, GitHub personal access tokens, and cloud credentials
- Compromise of trusted packages can cause operational disruption, incident response costs, and reputational damage across software publishers and consumers
- Scope:
- The GitHub fork-network issue is ecosystem-level because it affects dependency resolution behavior rather than a single package
- npm threat campaigns described by AWS operated at large scale, including 180 packages in the first Shai-Hulud wave, additional packages in a second wave, more than 150,000 malicious packages in a token-farming campaign, and nearly 1,000 suspicious 'elf-' packages later detected
- Exploitation status:
- The story states attackers are already exploiting the GitHub fork-network blind spot
- AWS documented active 2025 exploitation in the wild involving the Nx compromise, Shai-Hulud, Shai-Hulud 2, token-farming packages, and 'elf-' credential-stealing packages


