/> Update cookies preferences

How to Triage npm Malware Incidents | Free npm SBOM Tool for Fast Response

How to Triage npm Malware Incidents (Even Without Expensive Tools)

Aurora Starita
Security
September 20, 2025

In September 2025, the npm ecosystem was hit by a fast-spreading worm—dubbed Shai-Hulud (Dune fans know why)—that hijacked maintainer accounts and infected nearly 200 packages. For many security teams, this triggered a familiar scramble: are we exposed, and how do we check quickly? Larger enterprises may lean on commercial scanners, but smaller teams (or even big teams dealing with developer laptops and shadow installs) often find themselves googling “how to triage npm malware” at 11PM on a Friday. 

This blog is designed to be an evergreen playbook. We’ll use the latest npm worm as an example, but the guidance applies to any npm supply chain compromise. Whether you’re a one-person security team or part of a global enterprise, you’ll find practical steps, a free tool, and common pitfalls to avoid when npm malware strikes. 

Why npm Malware Keeps Coming Back 

Npm malware is a recurring problem. The npm ecosystem is massive, open, and highly dependent on volunteer maintainers. When even one maintainer account gets phished, every package they control can become a delivery mechanism for a npm supply chain attack. Features like post-install scripts and continuous integration access make it easy for an npm worm to spread quickly. 

That’s why incidents like the Shai-Hulud npm malware outbreak are basically inevitable. The key isn’t panic, but preparation: knowing that another attack will come, and having a clear way to triage exposure fast. 

First 24 Hours: What to Do Immediately 

When an npm worm or any other npm malware outbreak is unfolding, the first 24 hours are critical. It’s damage control time: you want to quickly identify exposure, limit blast radius, and secure your credentials.  

Here’s what to prioritize: 

  1. Check your exposure 
  • Review whether compromised packages were ever installed in your environment. 
  • Look at your CI/CD pipelines, developer laptops, and any production systems. 
  • Use tools (we'll link to ours below) that recursively scan package.json and package-lock.json files without executing any code. This gives you a safe inventory to cross-check against advisories. 
  1. Rotate secrets immediately 
  • Assume that any system which pulled malicious packages may have leaked credentials. 
  • Revoke and reissue npm tokens, GitHub personal access tokens, and cloud credentials (AWS, GCP, Azure). 
  • Do this from a clean workstation to prevent re-exposure. 
  1. Block further installs 
  • Temporarily pause or gate npm installs in CI/CD until you confirm which packages are safe. 
  • Use lockfiles (package-lock.json) to pin exact versions, and prevent automatic upgrades that might pull malicious versions. 
  1. Audit your CI/CD workflows 
  • Many npm worms persist by adding or modifying GitHub Actions or other CI jobs. 
  • Check for new workflow files, suspicious outbound webhooks, or scripts that were not part of your baseline. 
  1. Communicate quickly 
  • Let developers and incident response teams know what’s happening. 
  • Share a simple triage checklist so smaller teams (or those wearing many hats) don’t get stuck wondering what to do next. 

In other words, your triage npm compromise plan should emphasize speed and containment: know if you’re affected, cut off exposure, and secure your secrets. Incident response for npm worms will be focused on stopping the bleeding and buying time to investigate further, not perfection. 

Tools for Triage: From Crude to Sophisticated 

Not every team has the same resources, but everyone needs a way to quickly map out their npm dependencies when malware hits. Here are two practical approaches you can put into action right away: 

Free npm SBOM Tool 

Justin Borland, Director of Threat Engineering here at Abstract, built a simple script that generates a software bill of materials (SBOM) from your package.json and package-lock.json files—without actually installing code. By running npm with --package-lock-only and --ignore-scripts, you get a safe dependency inventory to cross-reference against advisories.  

It’s crude but effective, especially for small shops, incident responders under pressure, or larger orgs looking for fast validation outside of their usual scanners.  

It’s worth noting how this approach differs from simply running npm audit. The built-in audit checks dependencies against a vulnerability database but executes install logic, which can be risky during an active compromise. This SBOM script, by contrast, safely builds a dependency inventory without running code which makes it especially relevant when malware is spreading. 

Enterprise Security Scanners 

For larger teams, tools like Snyk and Dependabot provide automated visibility into vulnerable packages. They integrate with CI/CD and developer workflows, surfacing risks as part of the pipeline. These platforms do have blind spots, particularly on developer laptops, shadow repos, or systems outside the official build process. So even enterprises benefit from lightweight scripts alongside their formal tools. 

Open Source Security Scanners 

Smaller teams can look at projects like OSV-Scanner, Checkov, or Grype. These are free and community-driven, offering solid coverage for dependency and container scans. While they may lack some of the polish and integrations of commercial platforms, they can be combined with lightweight scripts to fill the gaps. 

Common Pitfalls to Avoid 

Even well-prepared teams can make mistakes in the heat of an npm malware incident. Here are some of the most common traps to watch out for: 

  • Relying on SBOMs alone. A static SBOM shows you what you think you’re using, but registries can change fast. Worms mutate packages in hours, so you need continuous checks rather than one-time inventories. 
  • Forgetting developer laptops or contractor machines. Enterprise scanners often focus on production pipelines, but malware frequently enters through dev boxes or side projects. Shadow installs are easy to miss. 
  • Assuming 2FA or compliance will save you. Two-factor authentication and policy paperwork don’t stop worms that exploit maintainer accounts or abuse trusted workflows. Don’t let a checkbox mentality create blind spots. 
  • Treating npm audit as a silver bullet. It only checks known vulnerabilities and executes install logic, which can be risky in an ongoing compromise. Safer alternatives, like SBOM generation without code execution, are essential. 

The lesson here is don’t assume your usual security practices will cover every angle. Build your triage npm compromise playbook with these pitfalls in mind.  

How to Future-Proof Against the Next Worm 

Responding in the moment is (obviously) important, but lasting resilience comes from preparing for the next npm worm before it arrives. Here are steps teams can take to future-proof their security posture: 

  • Maintain an evergreen triage playbook. Document your “first 24 hours” actions and update them after each incident. Having a checklist ready keeps smaller teams from scrambling when every minute matters. 
  • Use quarantine mirrors and strict version pinning. Host an internal registry or mirror where new packages are held until they’re verified. Pin dependencies to known-good versions so sudden upstream changes don’t slip into production unnoticed. 
  • Invest in provenance and signed builds. Require signed tags or verified publishers before allowing packages into your builds. Trust your own pipeline, not the public registry. 
  • Automate secret rotation. Make credential resets part of your standard playbook so it’s routine instead of chaos-driven. 

Building these safeguards now ensures that the next npm supply chain attack is just a manageable fire drill. 

Quick Checklist for Teams of Any Size 

If time is short and stress is high, here’s a concise checklist that any team can run through during an npm malware incident: 

  • Scan dependencies safely using the SBOM script or OSV‑Scanner without executing code. 
  • Check for known npm malware advisories and cross‑reference against your dependency inventory. 
  • Rotate secrets immediately—npm tokens, GitHub PATs, and cloud credentials.
  • Pause npm installs in CI/CD until affected packages are verified or replaced. 
  • Audit CI/CD workflows for new or modified scripts, suspicious webhooks, or privilege escalations. 
  • Pin versions in lockfiles to prevent pulling new, potentially compromised updates. 
  • Quarantine and verify any new third‑party packages before allowing them into production. 
  • Communicate clearly with developers, incident response, and stakeholders so everyone knows the plan. 

This npm incident response checklist gives both small and large teams a fast path to triage npm compromises without losing time to debate. 

Resources 

We linked to this above but in case you missed it, here’s the link to npm_sbom_generator.py — our ASTRO team’s lightweight Python tool that recursively processes your package.json and package-lock.json files to build an SBOM-style dependency inventory. It runs without installing any code and ignores install scripts, making it safer during active compromise or exploratory triage. Ideal for small teams or incident responders who need fast, actionable visibility. 

 

Show Transcript
Get In Touch