Software supply chain security in 2026: an enterprise playbook after the npm attack wave

npm v12 blocks install scripts, but July 2026's AsyncAPI attack ran at import time. Supply chain security needs defense in depth.

Read time
9 min
Word count
1.4K
Sections
8
FAQs
8
Share
Abstract secure software supply chain shield over a dark server backdrop
npm v12 blocks install scripts, but import-time attacks slip past it.
On this page · 8 sections
  1. What broke in July 2026
  2. Why blocking install scripts is necessary but not sufficient
  3. The defense-in-depth playbook
  4. What it costs if you get this wrong
  5. India-specific considerations
  6. FAQ
  7. How eCorpIT can help
  8. References

Summary. In four days in July 2026, two npm supply chain attacks showed why perimeter thinking fails. On 11 July attackers published malicious versions of the jscrambler packages using stolen credentials, with 1,479 downloads before removal. On 14 July, Microsoft Threat Intelligence caught a compromise of the AsyncAPI organisation: 5 poisoned package versions across 4 package names, republished within about 90 minutes, each carrying a loader that ran at import time rather than through an install script. That timing matters, because npm v12, the biggest redesign of npm in its 16-year history, ships this month and blocks install scripts by default. It would not have stopped the AsyncAPI payload. Supply chain attacks now cost $4.91 million per breach on average and take 267 days to contain, per IBM, and Cybersecurity Ventures put global damage near $60 billion in 2025. This is a playbook for defending a real software supply chain, and where eCorpIT helps teams that would rather not learn it during an incident.

What broke in July 2026

The two July incidents are worth reading together, because they attack different layers.

The jscrambler compromise on 11 July was the familiar shape. Attackers used stolen publishing credentials to push malicious versions of the package and its plugins. Those versions carried hidden native binaries that ran during installation or use, targeting developer workstations, CI/CD pipelines and build systems to harvest credentials and secrets. It is the pattern the whole industry has spent a year building defences against.

The AsyncAPI compromise three days later was different, and more instructive. According to Microsoft's analysis, the attacker did not break into npm at all. A misconfigured GitHub Actions pull_request_target workflow ran attacker-controlled pull request code, which exposed the project's asyncapi-bot publishing token. The attacker then rode the project's own release pipeline. The poisoned packages, @asyncapi/specs, @asyncapi/generator, @asyncapi/generator-components and @asyncapi/generator-helpers, were published through the legitimate GitHub Actions OIDC release workflows and carried valid provenance attestations, even though the commits that triggered them were unauthorised. Provenance signed the wrong thing correctly.

The payload was a hidden detached Node process that fetched an 8.2 MB second stage from IPFS and decrypted a modular runtime. One accuracy note that most coverage got wrong: in the build Microsoft analysed, the credential-harvesting module was present but disabled. Persistence and command-and-control were live; data collection was dormant. The capability targeted more than 100 environment variables, including GITHUB_TOKEN, NPM_TOKEN, AWS keys, ANTHROPIC_API_KEY and OPENAI_API_KEY, plus files like .npmrc, .aws/credentials and kubeconfig. It could have been switched on remotely at any time.

Why blocking install scripts is necessary but not sufficient

npm v12 is a genuine improvement. It sets allowScripts off by default, so npm install no longer runs preinstall, install or postinstall lifecycle scripts, including native node-gyp builds, unless the project explicitly allowlists them. It also stops installing Git dependencies and remote sources by default. GitHub is phasing out long-lived publish tokens too: from early August 2026, granular access tokens lose the ability to publish directly and can only stage a publish that a human approves with 2FA, with a second tightening scheduled for January 2027. Every team running npm install in CI should audit its allowlist now using npm 11.16.0 warnings, before upgrade day breaks pipelines.

Here is the catch. The AsyncAPI packages declared no lifecycle hooks at all. As Microsoft's researchers wrote, "because the trigger is an import rather than an install script, the common npm install --ignore-scripts mitigation does not neutralize it." The loader executed the moment any build imported the module. Blocking install scripts is real progress against install-time malware, and does nothing against import-time malware. The same report is blunt about why scanners missed it: "the absence of lifecycle hooks is a deliberate evasion choice. Security tooling that focuses on preinstall/postinstall auditing will not flag these packages."

Attack vector July 2026 example When code runs Does npm v12 stop it?
Install script (postinstall) jscrambler During npm install Yes, blocked by default
Native binary at install/use jscrambler plugins Install or first use Partly; native builds need allowlist
Import-time loader AsyncAPI On import/require in a build No
Pipeline takeover (OIDC) AsyncAPI root cause In your trusted CI No; carries valid provenance
Stolen publish token jscrambler At publish Reduced by staged publish, Aug 2026

The defense-in-depth playbook

No single control covers this. A working software supply chain programme layers cheap, boring controls so that any one failure is contained.

Fix dependency hygiene first. Pin exact versions, commit lockfiles, and install with npm ci. Add a cooldown so a release must age before your builds accept it. npm's own min-release-age feature and a floor of npm CLI 11.10.0 or later blunt the day-zero window that both July attacks exploited.

Block malicious packages at install. SBOM-first scanning with Syft plus Grype gives visibility, and a behavioural scanner such as Socket or OSV-Scanner flags packages that suddenly add network calls, install hooks or, importantly, import-time execution. Our note on defending CI against AI-hallucinated packages covers the slopsquatting variant of this.

Move to provenance, but do not trust it blindly. Adopt OIDC trusted publishing or staged publishing with human approval instead of long-lived tokens, and sign artifacts with Sigstore (cosign, Fulcio, Rekor) against SLSA build levels. We detail the setup in our guide to OIDC trusted publishing and cache-poisoning hardening. The AsyncAPI case proves provenance is necessary, not sufficient: it attested a compromised build honestly.

Harden your own release pipeline. The AsyncAPI breach started with a pull_request_target misconfiguration, a class of GitHub Actions bug called a pwn request. Review workflow triggers, restrict token scopes, require protected environments and approvals for publish jobs, and alert on anomalous automated publishes. Our deep dive on npm 12 install-script blocking in CI/CD pairs with this.

Contain the blast radius. Isolate secrets from build steps, restrict CI egress so a poisoned dependency cannot phone home, and purge shared npm and yarn caches after any incident. Rotate credentials from a clean host if a build ever imported a suspect version.

Control layer What it stops Example tooling Relative effort
Version pinning + lockfiles + cooldown Day-zero malicious releases npm ci, min-release-age Low
Malicious-package scanning Install and import-time payloads Socket, OSV-Scanner, Grype Low to medium
Provenance and signing Tampered artifacts Sigstore, SLSA, OIDC publish Medium
Pipeline hardening Pwn requests, token theft Protected environments, scoped tokens Medium
Secrets and egress isolation Exfiltration after compromise CI egress rules, secret managers Medium to high

What it costs if you get this wrong

The business case is not subtle. Compiled supply chain attack data for 2026 puts the average software supply chain compromise at $4.91 million with a 267-day lifecycle to identify and contain (IBM), records a 742% rise in attacks between 2019 and 2024 (CISA), and shows third-party involvement in breaches doubling from 15% to 30% in a single year (Verizon). Cybersecurity Ventures estimated global costs near $60 billion in 2025, with industry projections approaching $81 billion in 2026 (Juniper Research). The controls above cost a fraction of one incident. The real cost is usually the cleanup and the 267 days, not the tooling.

India-specific considerations

For Indian enterprises and startups, two rules sharpen the priority. CERT-In's directions require reporting cyber incidents within 6 hours of detection, so an unmonitored build pipeline is a compliance risk, not just a security one. The Digital Personal Data Protection Act 2023 (DPDP) adds duties around personal data that a leaked credential can expose. An SBOM and a monitored release pipeline are the fastest way to answer the two questions a regulator or customer will ask after an incident: what was in the build, and how did it get there. Teams shipping AI features should also read our secure AI-assisted development and AppSec service, since model-generated code widens the same attack surface.

FAQ

How eCorpIT can help

eCorpIT is a Gurugram-based, senior-led engineering organisation, founded in 2021 and assessed at CMMI Level 5, that hardens software supply chains for startups and enterprises. We map your dependency and build attack surface, roll out SBOMs, malicious-package scanning and OIDC-based signed publishing, and lock down CI/CD workflows against the pipeline-takeover pattern that hit AsyncAPI. As an AWS, Microsoft, Google and Kaspersky technology partner, we design aligned with CERT-In and DPDP requirements rather than bolting security on afterwards. To review your pipeline before an incident does, talk to our engineering team.

References

  1. Unpacking the AsyncAPI npm supply chain compromise and import-time payload delivery, Microsoft Security Blog, 15 July 2026
  1. Active exploitation alert: jscrambler npm packages compromised, Rescana, July 2026
  1. npm 12 disables install scripts by default to reduce supply chain risk, The Hacker News, July 2026
  1. Upcoming breaking changes for npm v12, GitHub Changelog, 9 June 2026
  1. npm v12: from implicit to explicit trust, JFrog, 2026
  1. The 2026 guide to software supply chain security, Cloudsmith
  1. Software supply chain security beyond SBOMs: Sigstore, SLSA and build provenance, AquilaX
  1. Global costs of software supply chain attacks on the rise, Cybersecurity Ventures
  1. Costs of software supply chain attacks could exceed $46B, Cybersecurity Dive
  1. Supply chain attack statistics 2026, AppSec Santa
  1. The npm threat landscape: attack surface and mitigations, Unit 42, updated 15 July 2026

_Last updated: 23 July 2026._

Frequently asked

Quick answers.

01 What is a software supply chain attack?
A software supply chain attack compromises code, dependencies or build systems that an organisation trusts, rather than attacking it directly. The July 2026 npm incidents are examples: attackers poisoned popular jscrambler and AsyncAPI packages so that any project installing or importing them ran malicious code inside its own pipeline.
02 Does npm v12 stop supply chain attacks?
npm v12 helps but does not stop them. It blocks install scripts, Git dependencies and remote sources by default, which defeats install-time malware. It does nothing against import-time payloads like the AsyncAPI loader, which run when a build imports the package, or against a takeover of your own release pipeline. You still need layered defences.
03 What was different about the AsyncAPI attack?
The AsyncAPI payload ran at module import, not through an install hook, so the common ignore-scripts mitigation did not stop it. Attackers exposed a publishing token through a misconfigured GitHub Actions workflow and rode the project's own release pipeline, so the poisoned packages even carried valid provenance attestations despite unauthorised triggering commits.
04 Did the AsyncAPI attack steal credentials?
In the build Microsoft analysed, the credential-harvesting module was present but disabled; persistence and command-and-control were active while data collection stayed dormant. The capability targeted over 100 secrets, including GITHUB_TOKEN, NPM_TOKEN and cloud keys. It could have been enabled remotely, so affected teams were advised to rotate credentials from a clean host.
05 How much does a supply chain breach cost?
IBM's 2025 Cost of a Data Breach Report puts the average software supply chain compromise at $4.91 million, with a 267-day lifecycle to identify and contain. Cybersecurity Ventures estimated global costs near $60 billion in 2025, and Juniper Research projected almost $81 billion in 2026. Prevention costs a small fraction of one incident.
06 What is an SBOM and do we need one?
An SBOM, or software bill of materials, is a machine-readable inventory of every component, library and dependency in your software, with versions and origins. It is the fastest way to answer what was in a build after an incident. Tools like Syft generate one and Grype scans it, and regulators increasingly expect it.
07 How does SLSA and Sigstore fit in?
SLSA is an OpenSSF framework defining build integrity levels, with the highest requiring non-falsifiable provenance from a hardened build platform. Sigstore provides keyless signing and a public transparency log through cosign, Fulcio and Rekor. Together they let you verify an artifact came from your pipeline, though you must still secure the pipeline itself.
08 What should we do first this week?
Pin versions and commit lockfiles, audit your npm install-script allowlist using npm 11.16.0 before upgrading to v12, and add a release cooldown with min-release-age. Then add a malicious-package scanner such as Socket or OSV-Scanner, and review your GitHub Actions workflows for pull_request_target misconfigurations.

About the author

Manu Shukla

Founder & Director

Founder of eCorpIT. Hands-on engineer leading senior-only delivery for AI apps, custom software, and cloud systems for global clients.

Subscribe

One engineering note a week. No fluff, no spam.

Senior-architect playbooks on AI agents, mobile apps, cloud, security, data, and marketing — delivered every Wednesday.

Past the reading

Read enough. Let's build something.

A senior architect responds in 24 working hours with scope, indicative cost, and a timeline. NDA before any technical conversation.