A supply chain attack can start with a package your team depends on or the pipeline that installs it. A compromised package can run a script during npm install and steal credentials the install process can read. If the attacker gets a valid publishing token, they can use it to release malware under your team's name.
Software supply chain security protects the packages you install, the pipelines you build with, and the credentials those pipelines use. Attacks on npm in 2025 and again in 2026 show why those risks can be hard to spot when reviewing your own code.
Copy link to headingWhat is software supply chain security?
Software supply chain security protects software against tampering from source code through release. It covers source repositories, direct dependencies, transitive dependencies (the packages your dependencies pull in), continuous integration (CI) and build pipelines, the credentials they use, and the artifacts you publish.
Copy link to headingWhat are the differences between application security and software supply chain security?
Application security focuses on how you build an application and how it behaves at runtime. Supply chain security focuses on the code you depend on and the systems you use to build and release it. Both can cover third-party code.
Copy link to headingWhy does software supply chain security matter?
A compromised package can affect many projects. Here's why teams need to account for that risk:
Blast radius. One stolen account can spread malware to any project that installs a compromised version. In September 2025, an attacker phished a maintainer and published malicious versions of 18 npm packages, including
chalkanddebug.Repeated attacks. The 2025 Nx compromise and the March 2026 Axios compromise show how attackers can reach users of a package through its release workflow or publishing account.
Buyer checklists. Customers and auditors can ask suppliers to follow secure development and build practices from SLSA v1.2 (Supply-chain Levels for Software Artifacts) and NIST's Secure Software Development Framework (SSDF).
Legal obligations. Since September 11, 2026, manufacturers covered by the EU Cyber Resilience Act (CRA) must report actively exploited vulnerabilities and severe security incidents under the CRA reporting rules.
Copy link to headingWhere software supply chain security breaks down in a JavaScript project
The Nx and Axios compromises affected projects that used those packages. The attackers didn’t need to exploit bugs in the projects’ own code.
Copy link to headingDependency versions
A package.json might list a few dozen direct dependencies. Its lockfile can record hundreds or thousands of packages. A caret range such as ^1.14.0 allows minor and patch releases below 2.0.0. Without an existing lockfile, the next install could have picked up the malicious axios@1.14.1.
Copy link to headingInstall scripts
npm packages can define install scripts (preinstall, install, and postinstall). If your settings let them run, they can read secrets available to the install process. In November 2025, the Shai-Hulud 2.0 compromise used install scripts in affected packages to launch malware.
Copy link to headingMaintainer accounts
An npm maintainer account may have permission to publish new package versions. An attacker with access to the account can publish under the package's name if they can meet or bypass its publishing requirements. Attackers phish maintainers or register lookalike package names. The September 2025 attack began with a fake two-factor authentication email from a lookalike domain. In 2017, npm removed the lookalike package crossenv, which read environment variables during installation and sent them to an external server.
Copy link to headingBuild pipelines
A build pipeline can install dependencies, run tests, and publish code. Each step can read the credentials available to its job. The Nx postmortem describes how a compromised workflow exposed a publishing credential. Keep untrusted pull request input out of shell scripts, and give each job only the permissions and credentials it needs.
Copy link to headingCommon software supply chain attacks on JavaScript projects
A software supply chain attack targets something a project relies on, such as a dependency, a maintainer account, or a build tool. A compromised package or tool can affect any project that uses the affected version. Here are some ways that happens:
Credential-stealing install scripts. If the scripts run, they can steal credentials the install process can read.
Self-spreading worms. Malware can use stolen credentials to publish infected versions of other packages those credentials cover. The Shai-Hulud campaign spread this way.
Compromised release workflows. In the TanStack compromise, the attacker published 84 malicious versions across 42 packages through the project's trusted publishing setup. Valid provenance can identify the source repository and build workflow. It can't tell you whether the workflow or its output was safe.
Backdoors in long-trusted projects. The upstream xz Utils releases
5.6.0and5.6.1shipped with a backdoor in their release tarballs, tracked as CVE-2024-3094.
Copy link to headingHow to improve software supply chain security for JavaScript teams
No single control stops every attack. These practices address different risks in dependency installs, builds, and releases.
Copy link to headingPin dependencies with a lockfile
When your package manager resolves dependencies, a version range can let it pick up a malicious release minutes after publication. In CI, install from the committed lockfile with npm ci, pnpm's --frozen-lockfile, or Yarn's --immutable. The install fails if it would need to change the lockfile. Vercel defaults to npm install for npm projects. To enforce the lockfile on Vercel, set the project's Install Command to npm ci.
For dependency updates, set a minimum release age with npm's min-release-age, pnpm's minimumReleaseAge, or Yarn's npmMinimalAgeGate. pnpm 11 has a one-day default, but it can pick a newer release if no eligible older version falls within the range. The delay gives maintainers time to remove malicious releases. Check how your package manager handles exceptions and urgent fixes.
Copy link to headingCheck package provenance
Provenance is a signed attestation that links a package to its source repository and build workflow. With trusted publishing, npm automatically creates provenance attestations for public packages from public repositories that use supported GitHub Actions or GitLab CI/CD runners. CircleCI supports trusted publishing without automatic provenance. Run npm audit signatures in CI to verify registry signatures and any available provenance for installed packages. Review the workflow and its output too. A compromised workflow can still produce valid provenance.
Copy link to headingKeep an SBOM for every build
A software bill of materials (SBOM) lists components and versions so you can find which builds contain a compromised package. The npm sbom command lists a project's npm dependencies in CycloneDX or SPDX format. Save the SBOM with each build artifact and check that it covers what you ship, including components outside npm.
Copy link to headingUse short-lived publish credentials
Anyone who copies a publish token from CI can use it until it expires or you revoke it. With npm trusted publishing, CI requests short-lived OIDC credentials when it publishes. This requires npm CLI 11.5.1 or later and Node.js 22.14.0 or later. In GitHub Actions, grant id-token: write only to the publish job and keep publishing credentials out of dependency install steps. For cloud access, use Vercel OIDC to set up an AWS role that only Production deployments of one Vercel project can assume.
Copy link to headingReview new dependencies and install scripts
New dependencies bring in code your team hasn't reviewed. Review lockfile diffs in pull requests and require approval for new packages and dependency scripts. Record which scripts can run in npm 12's allowScripts field, pnpm's allowBuilds setting, Yarn's dependenciesMeta field, or Bun's trustedDependencies field. npm 12 and Yarn 4.14 or later skip unapproved third-party scripts by default. With strictDepBuilds on, pnpm fails the install if it finds an unreviewed dependency build script. It skips scripts you've explicitly denied.
Copy link to headingWhat to do when a dependency in your software supply chain is compromised
Start containment as soon as you suspect exposure. You can investigate, recover, and send required notifications in parallel.
Contain the incident and identify exposure. As part of incident containment, pause affected builds and releases, isolate affected machines or runners, and promptly revoke exposed credentials. Save the logs. Check lockfiles, SBOMs, and installed packages against the advisory to find affected developer machines and CI runs. The Axios remediation advisory shows what to look for.
Pin a known-good version. Use a supported, patched release the maintainer recommends. Update the lockfile and check that no affected versions remain.
Remove persistence before issuing replacements. Check affected environments for unexpected changes to shell profiles, workflow files, and other startup or automation settings. Remove those changes or rebuild the environment from a trusted source.
Rotate CI, publish, and cloud credentials. Replace any credentials an affected machine or build could read. Issue the replacements from a clean environment. If you rotate a secret shared by several Vercel projects, redeploy each project that uses it so it picks up the new value.
Purge caches and rebuild from a clean lockfile. Clear affected build and local npm caches. Remove affected versions from internal mirrors, which can still serve them after npm removes them. On Vercel, deploy the commit with the fixed lockfile and skip the build cache. If a shared Remote Cache may contain a compromised artifact, a team Owner can clear that cache separately so other builds don't reuse it.
Notify downstream users. If you maintain an affected package, deprecate the affected releases and publish an advisory. If CRA reporting applies, start during containment. Use the Single Reporting Platform, which ENISA, the EU cybersecurity agency, runs. Submit the early warning within 24 hours of becoming aware of the issue and the full notification within 72 hours.
Your hosting platform can help block affected versions and clear build caches.
Copy link to headingHow Vercel helps JavaScript teams secure their software supply chain
Vercel's controls apply to the builds it runs and how those builds reach production. Your team still chooses which dependencies to install and manages what it publishes to npm. During the September 2025 incident affecting chalk and debug, Vercel cleared build caches for 76 affected projects that day and told customers which projects to rebuild.
Copy link to headingBlock known malicious packages in builds
A malicious package can run code during installation if you allow your package manager to run dependency scripts. In November 2026, Vercel added automatic checks that scan supported lockfiles before installation and block affected public npm downloads during installation. The checks run on new builds on all plans. New rules typically reach builds within minutes. When Vercel finds a blocked version, it fails the deployment, shows the package and version, and tries to invalidate the affected build cache.
Copy link to headingFind unpatched projects and risky settings
Pull request scans only check changes that go through a pull request. Security Actions Dashboard groups affected projects and shows what to fix. During the React2Shell disclosure (CVE-2025-55182), Vercel listed affected projects there and used web application firewall (WAF) rules to filter known exploit patterns while teams patched.
The Security Dashboard checks team and project settings on all plans. It flags members without multifactor authentication, personal access tokens that never expire, stored credentials you could replace with OIDC, disabled fork protection, and unprotected previews. In CI, run vercel security check with --json and use the report to decide whether to stop the pipeline. The command can exit 0 even when checks fail.
Copy link to headingLimit where build secrets can leak
Vercel runs builds in isolated microVMs and destroys each microVM when its build ends. Secret environment variables are write-only after you save them. Build logs redact matching Secret values of at least 32 characters and always redact VERCEL_OIDC_TOKEN and VERCEL_AUTOMATION_BYPASS_SECRET.
Code that runs during a build can read the secrets available to it. That includes dependency install scripts. Keep secrets out of builds that don't need them and use different credentials for Production and Preview. Team Owners can turn on Require Separate Values under Separate Production Secret Values so the same Secret key can't use its Production value in another environment. With Git fork protection on, pull requests from public forks need approval to deploy unless the commit author is already a Vercel team member. Use OIDC federation instead of stored keys and tokens when the receiving service supports it.
Copy link to headingControl who ships to production
Deployment Policies limit which sources and tools can create deployments. On Pro and Enterprise, team Owners can set Production to accept only Git deployments from an approved repository. Deployment Checks control when Vercel automatically assigns the deployment to production domains. If GitHub Actions reports the result of your dependency review, make that GitHub check required. Vercel waits for it to pass before automatically promoting the build. Authorized users can bypass the checks with Force Promote. Roles and permissions determine who can promote or roll back a deployment. Enterprise teams can stream activity to security tools through Audit Log Drains.
Copy link to headingBuild a layered defense for your JavaScript supply chain
Start by checking how CI installs dependencies and how your release pipeline signs in to npm. Then review which dependency scripts can run and what controls are in place before a deployment reaches production.
If you already deploy on Vercel, open your team's Security Dashboard and review accounts without multifactor authentication, personal access tokens that never expire, and projects with unprotected previews.
Copy link to headingFrequently asked questions about software supply chain security
Copy link to headingDo SLSA, NIST SSDF, and the EU CRA apply to small JavaScript teams?
Teams can adopt SLSA and the SSDF even if no contract requires them. The CRA applies to manufacturers that place covered products with digital elements on the EU market, regardless of team size. The rules for a given product or hosted service depend on the regulation's definitions and your organization's role, so check with counsel.
Copy link to headingWhat is dependency confusion?
Dependency confusion happens when a build looks for an internal package but installs a package with the same name from another registry, such as a public one. Use an organization scope for private packages, map the scope to your private registry, and check that your registry or proxy won't look up internal names in public registries.
Copy link to headingHow do AI coding agents change supply chain risk?
Agents can suggest packages no one has reviewed, including packages that don't exist. In a package hallucination study of Python and JavaScript, 19.7% of 2.23 million package references the tested models generated were for nonexistent packages. Check package names and registries before installing a package an agent suggests, and isolate agent-generated code when you run it. Notion Workers, for example, run on Vercel Sandbox. Network policies can limit which services the code can reach. The Sandbox proxy can add credentials to approved API requests without giving the code access to the keys.