Web Dev

Software Supply Chain Security for Web Apps: npm, SBOM, Vendors

In this article
  1. Key takeaways
  2. What is software supply chain security for a web app?
  3. How do npm package attacks reach a business website?
  4. What did npm change in 2026, and what does it mean for you?
  5. Do lockfiles protect you from malicious packages?
  6. What is an SBOM, and do you need one?
  7. What should you ask a web development vendor about supply-chain security?
  8. What should you do when a package you use is reported compromised?
  9. Frequently Asked Questions
  10. Sources

Short answer: Software supply chain security for web apps means controlling every third-party package, build tool and pipeline that ends up in your code. For most business sites that starts with npm: commit a lockfile, install with npm ci, block install scripts, wait a few days before taking new versions, keep a software bill of materials (SBOM), and ask your vendor to show each of these working.

Key takeaways

  • OWASP's 2025 Top 10 lists Software Supply Chain Failures third, and it was the top concern in OWASP's community survey.
  • Recent npm attacks did not exploit bugs in your code. They hijacked trusted packages and ran code the moment a developer or build server installed them.
  • npm itself tightened defaults in 2026: npm 12 (July 2026) blocks dependency install scripts unless you allow them, and publishing now leans on short-lived, auditable credentials.
  • An SBOM is the inventory that lets you answer "are we affected?" in minutes. The EU Cyber Resilience Act will require one for many products from December 2027.
  • Ask vendors for evidence (a lockfile in the repository, a CI log, a sample SBOM), not a yes on a questionnaire.

What is software supply chain security for a web app?

It is the practice of trusting, verifying and tracking everything your application is built from that your own team did not write: open-source packages and their dependencies, build tools, CI/CD services, container images, browser scripts loaded from other domains, and the accounts that publish all of them. A modest JavaScript project can pull in hundreds of indirect dependencies, and any one of them can change between two builds.

OWASP made this its own category in the 2025 Top 10. A03:2025 Software Supply Chain Failures ranked third overall, and half of the respondents to OWASP's community survey ranked it first, according to OWASP Top 10: A03 Software Supply Chain Failures (2025). Its prevention list starts with keeping an SBOM that covers transitive dependencies.

How do npm package attacks reach a business website?

The recent pattern is consistent: attackers steal or phish a maintainer's credentials, publish a poisoned version of a popular package, and let automatic updates carry it into thousands of projects. The malicious code usually runs at install time, on developer laptops and build servers, and goes after the secrets stored there: cloud keys, GitHub tokens and publishing tokens.

  • The Shai-Hulud worm (September 2025). CISA reported that a self-replicating worm compromised more than 500 npm packages, harvested developer credentials including GitHub tokens and cloud API keys, and used stolen npm access to infect further packages, per CISA: Widespread supply chain compromise impacting npm ecosystem (2025).
  • The axios compromise (March 2026). Two published versions of axios, one of the most widely used HTTP libraries, added a malicious dependency that downloaded a remote access trojan, according to CISA: Supply chain compromise impacts Axios (2026). CISA's advice included turning off install scripts and refusing packages younger than seven days.

Two lessons follow. First, the build machine is part of your attack surface, not just the production server. Second, "always take the latest version" is the riskiest policy, because a short delay gives maintainers and the registry time to spot and pull a poisoned release.

What did npm change in 2026, and what does it mean for you?

ChangeDateWhat it means for a site owner Staged publishing: new versions wait for a maintainer's 2FA approval before anyone can install themMay 2026 (opt-in)Packages you depend on can adopt a human check before release; you cannot force it npm 12 blocks dependency lifecycle scripts unless the root project allows them; git and remote-URL dependencies default to offJuly 8, 2026Installs on npm 12 skip those scripts until you allowlist them; treat that as a security gain, not a bug to switch off Dependabot waits at least three days before proposing version updates (security updates are not delayed)July 2026Update pull requests now arrive after a short cooldown by default Unvalidated trusted publishing configurations expire after 48 hours; issue_comment workflows can no longer publishOctober 2, 2026Fewer ways to hijack a package's automated release pipeline The table draws on the npm CLI v12.0.0 release notes (2026), the GitHub Changelog on staged publishing (2026), the GitHub Blog: Disrupting supply chain attacks on npm and GitHub Actions (2026) and the GitHub Changelog on trusted publishing expiry (2026). These registry changes reduce risk; they do not remove it. Your own build settings still decide what gets installed.

Do lockfiles protect you from malicious packages?

Partly. A lockfile (package-lock.json, yarn.lock or pnpm-lock.yaml) records the exact version and checksum of every dependency, so the same code is installed each time. It stops a poisoned release from slipping in silently, but it will happily reinstall a bad version if someone already locked it. Pair it with these controls:

  1. Commit the lockfile and build with npm ci. npm's documentation says npm ci requires a lockfile, exits with an error when it does not match package.json, and never rewrites either file, per npm Docs: npm ci (2026).
  2. Block install scripts. Set ignore-scripts=true on older npm versions, or keep npm 12's default and allow only the few packages that genuinely need a build step.
  3. Add a cooldown. npm's min-release-age setting installs only versions published more than a set number of days ago, per npm Docs: config (2026). Seven days matches CISA's suggestion after the axios incident.
  4. Review lockfile changes in pull requests. A new, unfamiliar dependency appearing deep in the tree deserves a question.
  5. Check signatures and provenance. npm audit signatures verifies registry signatures and provenance attestations, but npm's own docs say provenance does not guarantee a package has no malicious code, per npm Docs: Generating provenance statements (2026).
  6. Keep secrets out of install steps. Give build jobs short-lived credentials, and rotate anything that was present when a compromised package ran.

The same habits apply to PHP Composer, Python and WordPress plugins. A managed theme and plugin update service should follow a cooldown and a test step too, rather than auto-updating production.

What is an SBOM, and do you need one?

A software bill of materials is a machine-readable list of every component in a build, with versions, suppliers, licenses and hashes. When the next poisoned package is announced, the SBOM tells you in minutes which apps contain it. The two common formats are SPDX and CycloneDX, and most build tools can generate either.

CISA published its 2026 Minimum Elements for a Software Bill of Materials on July 29, 2026, building on the 2021 NTIA baseline and adding fields such as component hash algorithm, component license, SBOM tool name and generation context, per CISA (2026). Use it as the checklist when a vendor hands you an SBOM.

In Europe, the Cyber Resilience Act entered into force on December 10, 2024; its reporting obligations apply from September 11, 2026 and its main obligations from December 11, 2027, per the European Commission: Cyber Resilience Act (2026). Annex I asks manufacturers to draw up an SBOM in a commonly used, machine-readable format covering at least top-level dependencies, according to the Regulation (EU) 2024/2847 on EUR-Lex (2024). Its recitals point pure cloud services such as SaaS to the NIS2 Directive instead, so whether the Act covers your product is a question for a qualified adviser.

What should you ask a web development vendor about supply-chain security?

QuestionA good answerA red flag Is the lockfile committed, and does CI install with npm ci or an equivalent?Yes, shown in the repository and build log"We run npm install on the server" How do you handle install scripts and new package versions?Scripts blocked by default, a cooldown, updates reviewed in pull requestsAutomatic updates straight to production Can you deliver an SBOM with each release?Yes, in SPDX or CycloneDX, generated by the pipelineA spreadsheet maintained by hand, or no answer How are publishing and deploy credentials protected?Phishing-resistant MFA, short-lived tokens, no long-lived secrets in CIShared accounts or one token used everywhere What happens when a dependency is reported compromised?A written process: check the SBOM, pin, rotate secrets, report to you"We would look into it" Who owns the repository and build accounts?You do, with the vendor added as a memberCode and pipelines only in the vendor's accounts Ask for these in the contract or statement of work, along with how quickly they will tell you about an incident. If you are reviewing an existing app, a security audit can check the pipeline as well as the code, and our web application development projects at Alive Inc. include these controls in the build. The infrastructure checklist for multi-country sites covers hosting and backups alongside them.

What should you do when a package you use is reported compromised?

  1. Search your lockfiles, SBOMs and artifact caches for the affected versions, including indirect dependencies.
  2. Pin to a known-safe version and rebuild from a clean environment.
  3. Rotate every credential that was present on machines or CI jobs that installed the bad version: cloud keys, repository tokens, npm tokens, SSH keys.
  4. Check outbound network logs from build machines for the indicators the advisory lists.
  5. Write down what happened and which control would have stopped it, then add that control.

This order follows CISA's recommended actions in both npm advisories cited above.

Frequently Asked Questions

What is a software supply chain attack in web development?

It is an attack that reaches your application through something you depend on rather than through your own code: a hijacked open-source package, a compromised build tool, or a stolen publishing account. The malicious code arrives during a normal install or update, often running on developer machines and build servers before anything reaches production.

Is npm audit enough to stop malicious packages?

No. npm audit reports known vulnerabilities from advisory databases, so it catches problems only after they are published. A freshly poisoned version can be installed before any advisory exists. Combine it with a committed lockfile, npm ci, blocked install scripts and a release-age cooldown.

Do small business websites need an SBOM?

If your site is a simple CMS install, a current list of plugins and versions may be enough. If you run a custom web app, a portal or a SaaS product, an automatically generated SBOM is cheap to produce and makes incident response much faster. Some customers and regulations now ask for one.

What should a vendor's SBOM include?

At minimum, each component's name, version, producer, a unique identifier, a hash and its license, plus who generated the SBOM, with which tool, and when. CISA's 2026 minimum elements list these fields and is a practical checklist for reviewing what a vendor gives you.

Sources

Share:
Back to Insights