Disrupting supply chain attacks on NPM and GitHub Actions
Disrupting supply chain attacks on NPM and GitHub Actions

By Greg Ose & Zachary Steindler | July 28, 2026 | ⏱️ 7 min read
Over the last year, we have observed a recurring trend in supply chain attacks. Malicious actors are exploiting vulnerabilities within CI/CD pipelines and package registries to rapidly inject malware into hundreds of open-source projects. The primary goal of this malware is the exfiltration of credentials, which allows attackers to broaden their reach and facilitate future exploits.
GitHub has been transparent about its hardening strategy through several previous announcements:
- September 2025: Strategy for a more resilient npm supply chain.
- December 2025: Preparing for large-scale malware campaigns.
- March 2026: The security roadmap for GitHub Actions.
This article details the specific updates we have deployed to break the most common attack vectors and reduce the overall blast radius of these campaigns.
🛡️ The Anatomy of a Supply Chain Attack
Supply chain attacks are not the result of a single failure; they are a "chain" of exploited weaknesses. Because no single tool can stop them entirely, we employ a holistic defense strategy.
We can model the attack lifecycle as follows:
To stop this cycle, we must disrupt the links. The mathematical risk can be viewed as:
By reducing the Probability of Execution at each stage, we effectively neutralize the threat.
🛑 Phase 1: Preventing Initial Compromise
Attackers usually enter the ecosystem by hijacking a maintainer's account or exploiting a project's automation workflows.
npm Account Safeguards (June 2026)
Phishing remains a primary entry point. To counter this, high-impact npm accounts now enter a read-only state for 72 hours if:
- The account email is changed.
- A 2FA recovery code is utilized.
This "cooling-off" period provides the legitimate owner a critical window to reclaim their account before an attacker can publish malicious versions of a package.
Hardening GitHub Actions (June 2026)
We have addressed several "pwn request" patterns where untrusted code from a fork is executed via pull_request_target.
| Feature | Change | Impact |
|---|---|---|
actions/checkout | Changed defaults to block untrusted fork code. | Prevents arbitrary code execution during PRs. |
| Workflow Policies | New Enterprise/Org/Repo level controls. | Implements least-privilege for trigger types. |
| Actions Cache | Restricted write access for untrusted triggers. | Stops "cache poisoning" used for privilege escalation. |
Old Way: Trust all PR triggers by default New Way: Explicit opt-in for risky triggers.
For example, a secure checkout configuration now looks like this:
- uses: actions/checkout@v4
with:
# Untrusted code is no longer checked out by default
# in sensitive triggers.
persist-credentials: false
🔑 Phase 2: Stopping Credential Exfiltration
Once inside, attackers hunt for secrets (API keys, tokens) to move laterally across the ecosystem.
Eliminating Long-Lived Secrets
The most effective way to stop secret theft is to ensure there are no secrets to steal.
- npm Trusted Publishing (April 2026): We have extended support to CircleCI. This allows developers to publish packages without storing long-lived tokens in their CI environment.
Monitoring Network Egress
We are currently in a technical preview of the Actions Network Firewall.
- Current Capability: Logs all outbound traffic from workflow runs.
- Goal: Identify anomalies, such as a workflow suddenly sending data to an unknown external domain.
- Future State: Full egress blocking and policy-based restrictions.
🚀 Phase 3: Blocking Attack Propagation
If an attacker successfully steals credentials, they attempt to distribute malware to as many users as possible.
npm Staged Publishing (May 2026)
Possessing publishing credentials is no longer a "golden ticket." With Staged Publishing, new packages are held in a staging area. They are not immediately available to the general public, allowing for a verification step before the malware can propagate.

✅ Security Checklist for Maintainers
To further protect your projects, we recommend the following actions:
- Enable 2FA on all npm and GitHub accounts.
- Audit your
pull_request_targetworkflows. - Migrate to Trusted Publishing (via GitHub Actions or CircleCI).
- Review your workflow execution policies at the Org level.

For more information, explore our Docs, GitHub updates, or Customer Stories. See you at GitHub Universe 2026!