The engineering software supply chain security decision record: why the dependency vetting model you chose determines your transitive vulnerability ceiling and your supply chain attack surface
Supply chain security decisions are made once — when the first CI pipeline is wired up, when the first dependency scanner is configured, when the first security audit is passed — and rarely revisited as the dependency tree grows from 50 packages to 500. The team decides to run npm audit in CI and block on any critical CVE. Two years later, the team has 12 services, 3,000 transitive dependencies, and a CVSS 9.1 CVE blocking every deployment because nobody built the exploitability model that distinguishes a critical CVE whose attack path is unreachable in their specific implementation from one that is not. The dependency inventory model, the CVE triage process, the new-dependency vetting gate, and the package ingestion restriction are founding decisions about how quickly the team can respond to a published vulnerability and how wide the blast radius is when a malicious package enters the dependency tree — decisions that most teams make implicitly at CI-setup time and discover have structural consequences at the moment of a supply chain incident or a CVE that paralyzes the deployment pipeline.
A 19-person developer tools startup built its platform as a set of seven Node.js microservices, each with its own package.json and package-lock.json. They used Dependabot for direct dependency updates and ran npm audit in CI with advisory-mode warnings — no CI blocking, just informational output that engineers could choose to act on or ignore. For 14 months, the approach worked: Dependabot kept the direct dependencies reasonably current, and the advisory output was low enough that engineers checked it occasionally. No one had thought about transitive dependencies as a distinct category. The assumption was that keeping direct dependencies updated would keep transitive dependencies safe, because upstream maintainers would update their own transitive deps when CVEs were published.
In November, a CVE was published for semver — a package used for semantic version string parsing and comparison. The vulnerability was a ReDoS (Regular Expression Denial of Service): a crafted version string like 1.2.3-X.7.Z.7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 would cause the regex engine to consume unbounded CPU for several seconds per call. CVSS 7.5 — High severity. The vulnerability was real and the proof-of-concept was public within 48 hours of publication.
The team lead saw the CVE in a security newsletter three days after publication. She ran npm audit in the main API service repository and saw the warning. She posted in the team's #security Slack channel: "anyone know which services use semver? We need to patch this." The responses were: "I think it's just the build tooling, not production" and "not sure, check the lockfiles." She checked the main API service's package-lock.json — semver was there as a transitive dependency of @babel/core and webpack. Both were devDependencies: used in the build pipeline, not in the production runtime. Not a production exposure for that service. She checked the frontend service. Same pattern — build tooling only. She moved to the third service, then the fourth. By the second hour, she had checked five of the seven services manually by grepping through lockfiles: build tooling only, no production runtime exposure. She reached the sixth service: the user permissions utility microservice, a lightweight API that accepted version strings from API request parameters to handle feature-flag version range matching. That service's production runtime bundle included semver as a transitive dependency of node-semver-resolver, a direct dependency used for the feature-flag logic. The production runtime was exposed.
The 2-hour investigation to reach a "which services are affected?" answer was not exceptional incompetence — it was the predictable result of having no dependency inventory. A Software Bill of Materials (SBOM) generated at build time and stored in a queryable format would have produced the same answer in three minutes: query the SBOM inventory for all services where semver appears as a production runtime dependency, filtered to versions below the patched version. The investigation time was 2 hours; the investigation had a 2-hour lower bound given the absence of an inventory. The remediation took an additional 8 days — not because the fix was complex (a one-version bump of node-semver-resolver was sufficient) but because the investigation result landed on a Thursday afternoon and the team lead made the judgment call that it could wait until the next sprint cycle rather than being treated as an urgent out-of-band fix. Total elapsed time from CVE publication to production patch: 11 days. The user-facing exposure was a ReDoS in an endpoint that accepted version strings from authenticated API consumers — a low-probability, high-severity risk in their specific context — but the 11-day remediation window was not driven by risk calculation. It was driven by the inventory gap that converted a 3-minute impact assessment into a 2-hour investigation, arriving on a Thursday, too close to end-of-day to be treated as urgent.
A 44-person B2B SaaS had made supply chain security a priority after a third-party security audit the previous year. They configured Snyk in block mode: any high or critical CVE in a direct or transitive dependency caused the CI pipeline to fail and blocked the deployment. The policy had been in place for eight months. During that time, it caught three real issues that required patching before deploy, and the median time between CVE publication and patch deployment for high/critical CVEs was 4 days — a defensible posture. The engineering team had accepted that occasional deploy blocks were the cost of the security model.
In April, jsonwebtoken — the team's direct dependency for JWT signing and verification, used in the authentication service on every API request — received a CVE with CVSS 9.1 "Critical." The vulnerability description: a verification bypass when the JWT header includes an alg: none parameter, allowing an unauthenticated attacker to forge tokens that pass signature verification. The attack class was well-known and the CVE was widely reported in security newsletters. CVSS 9.1 was the correct score for the worst-case attack scenario: an unauthenticated attacker with the ability to send JWT-authenticated requests to the target API, where the target API's JWT verification accepts the alg: none header parameter.
The team's authentication middleware did not accept alg: none. Two years earlier, the backend lead who built the initial authentication layer had read a security post about the alg: none attack class and added an explicit middleware check: before passing a token to jsonwebtoken.verify(), the middleware extracted the JWT header using a manual Base64 decode and validated that the alg field matched one of three allowed values: RS256, RS384, or ES256. Any token with alg: none was rejected with a 401 before the JWT library was ever called. The CVE's described attack path — submitting a JWT with alg: none — was not reachable in this implementation. The jsonwebtoken library would never see an alg: none token.
Snyk blocked every deployment. The CI pipeline for every service in the monorepo failed with the CVE identifier. The engineering team had a backlog of eight deployments that week, including a critical bug fix for a data processing pipeline that was failing to handle a character encoding edge case and causing data corruption for three enterprise customers who had filed support tickets. The backend lead who had implemented the defensive algorithm check — the specific person who could accurately assess the CVE's exploitability in the team's implementation — was at a conference for two days. The security lead who had the credentials to issue a Snyk exception policy was on PTO in an area with no connectivity. The on-call engineer's attempt to reach her via emergency contact on the second day was unsuccessful.
At the start of the third day, the incident fix could no longer wait. The CTO authorized a .snykignore entry for the CVE identifier, which lifted the block globally — for every service in the monorepo, not just the authentication service, and not scoped to the specific code path where the CVE was unexploitable. The incident fix deployed. Three weeks later, a junior engineer building a new analytics export service copied the JWT verification pattern from an internal code snippet she found in the shared utilities directory — the original version, without the defensive algorithm check, because the utilities directory had not been updated since the middleware was refactored and the defensive check was added to the middleware layer rather than to the utility function. The new analytics service was vulnerable to the CVE that the global Snyk ignore entry had dismissed. The analytics service was discovered to be vulnerable four months later during a penetration test.
The failure had two distinct components. The first was the absence of a structured exploitability triage model: the response to a CVE was binary — block or don't block, based on CVSS score — with no mechanism to represent "this CVE is not exploitable in our specific implementation because of compensating control X, documented by engineer Y, valid until condition Z changes." The second was the global-ignore escape valve: when the binary model created an impossible situation (block everything vs. ignore everything), the team chose the ignore-everything path under time pressure, and the global ignore outlasted the context in which the decision was made. An exploitability model that produced a service-scoped, documented, time-bounded exception — rather than a global ignore — would have allowed the incident fix to deploy without dismissing the CVE's relevance across services that did not have the compensating control.
A 72-person enterprise SaaS had good engineering hygiene by most standard measures: mandatory code review, staged deployments through three environments, automated test coverage above 80%, and a security-conscious engineering culture that had been built deliberately after a data incident two years earlier. What the team had not addressed was the package ingestion model: any engineer could run npm install <package-name> on their workstation or in a feature branch, the lockfile would be committed with the PR, and the standard code review process would evaluate the application code but would not specifically examine new transitive dependencies introduced by the new package.
In August, a senior engineer was building a new Stripe webhook handler service. She found a blog post recommending stripe-webhook-utils, a utility library that reduced webhook signature verification boilerplate. The blog post was written by a credible author with an established reputation in the payments space; the package had 847 weekly downloads on npm and 23 GitHub stars. She ran npm install stripe-webhook-utils. The package installed without errors. She wrote the webhook handler, wrote tests, opened a PR, and received approval from two reviewers who verified that the webhook signature verification logic was correct and the tests passed. The PR merged.
What none of them knew: stripe-webhook-utils@2.1.4, the version npm resolved from the latest tag, had been published 11 days earlier with a new transitive dependency: node-utils-extra@1.0.3. The stripe-webhook-utils package's author had not published this version — their npm account had been compromised in a credential stuffing attack three days before the engineer ran npm install. The attacker published 2.1.4 as a patch update (bypassing any update policies that restricted major or minor version bumps) and added node-utils-extra as a dependency. node-utils-extra@1.0.3 was a package published 6 days earlier by a newly created npm account with no prior packages. Its package.json included an install script: a one-line Node.js invocation that collected all environment variables and sent them to a remote server via an HTTPS POST with the hostname encoded as a Base64 string in the package's README.md.
The install script ran on the engineer's workstation when she executed npm install stripe-webhook-utils. It ran again in the CI pipeline when the GitHub Actions runner executed npm ci to install dependencies before running tests. It ran on the workstations of the two reviewers who checked out the branch to verify the code locally. Environment variables captured: on the engineer's workstation, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (developer credentials with read access to production S3 buckets and the ability to assume a production RDS role), DATABASE_URL (connecting to the production database via an IAM-authenticated proxy), and STRIPE_SECRET_KEY (the production Stripe secret key used for local webhook testing). In the CI pipeline: the same AWS credentials used by the CI environment for staging and production deployments, plus RESEND_API_KEY and several internal service API keys stored as GitHub Actions secrets and injected into the runner environment.
The attack was detected 11 days after the original install. The company's AWS CloudTrail monitoring flagged an AssumeRole API call from an IP address in Romania that had not previously appeared in the company's access logs, using the CI environment's AWS credentials to assume a production deployment role and enumerate S3 bucket contents. The incident response team traced the credential to the CI pipeline, then to the GitHub Actions secrets, then to the npm install step in the pipeline, then to the lockfile change that introduced node-utils-extra. By that point, the attacker had made four database queries using the leaked credentials — two of which returned customer PII rows — and had made 23 Stripe API calls using the leaked Stripe secret key, including a successful charge attempt that was reversed after the incident was contained. The remediation required rotating every credential that had been in the CI environment and in the affected engineers' workstation environments, invalidating every session token issued with those credentials, and conducting a data exposure review for the customer records returned by the unauthorized database queries.
The post-incident review identified four missing controls. First: no internal npm mirror requiring package review before installation — every package published to npmjs.org was immediately installable by any engineer with no review gate. Second: install scripts were not disabled in CI or on developer workstations — npm ci --ignore-scripts would have prevented the exfiltration entirely, because the malicious behavior was entirely in the install script, not in the package's runtime code. Third: no package provenance verification — a Sigstore cosign signature check would have flagged that stripe-webhook-utils@2.1.4 was not signed by the same keypair as 2.1.3 and earlier versions, indicating a publisher change. Fourth: developer workstations shared production-level credentials with the CI pipeline — the blast radius of a compromised developer install was identical to the blast radius of a compromised CI pipeline, because both environments had access to the same production credentials.
Structural properties set by the supply chain security decision
Two structural properties are determined by the founding decisions about dependency inventory, vulnerability triage, package ingestion, and credential scope. Both are invisible during the long periods when the dependency tree is stable, CVE publication rates are low, and the package ecosystem is free of active malicious campaigns. Both become visible at exactly the moment when a vulnerability is published affecting the team's dependency tree or when a malicious package enters a developer's install path.
Property 1: Transitive vulnerability ceiling. The transitive vulnerability ceiling is the upper bound on how quickly a team can respond to a published vulnerability affecting their dependency tree, determined by two interacting decisions: the dependency inventory model and the CVE triage model. The inventory component is determined by whether a machine-queryable Software Bill of Materials is generated at build time and stored in a format that supports cross-service queries. The fundamental question at the start of every CVE response is "which of our services are affected?" — and the time to answer that question is bounded entirely by whether a queryable inventory exists. A team without an SBOM answers the question by traversing lockfiles: for each service, parse the lockfile, extract the dependency list, check whether the vulnerable package appears. For a team with 3 services and shallow dependency trees, this takes 20 minutes. For a team with 20 services and dependency trees 6 levels deep, it takes half a day and produces errors — lockfile traversal is non-trivial when the same package appears at multiple versions across different branches of the tree and the question is "does the production runtime bundle include version X.Y.Z?" rather than "does the lockfile mention this package name." The SBOM converts a 2-hour investigation into a 3-minute query, and the 2-hour investigation overhead is not a fixed cost — it scales with the number of services and the depth of the dependency tree in ways that make it increasingly unreliable as the system grows. The triage component is determined by whether the response model evaluates CVEs against exploitability context rather than face-value CVSS score. CVSS scores are computed without knowledge of the target system's specific implementation — a CVSS 9.1 "Critical" is computed assuming worst-case attack conditions: unauthenticated access, network-accessible vulnerable endpoint, no compensating controls. Most production systems have compensating controls that make specific CVEs unexploitable in their specific implementation. Without a triage model that produces an exploitability assessment — yes, the attack path is reachable in our implementation; no, it is not reachable because of compensating control X — the response bandwidth is consumed by CVEs whose attack paths are unreachable, and the signal-to-noise ratio of the security response process degrades until engineers treat the entire CVE notification stream as background noise. Connect this to the security scanning decision record: SAST/DAST scanners and dependency scanners serve different functions — SAST/DAST identifies vulnerabilities in code the team wrote; dependency scanners identify vulnerabilities in code the team imported; the exploitability triage model for dependency CVEs must account for the same application-layer compensating controls that SAST/DAST scanning is designed to verify — the two scanners are upstream-downstream of each other, and the triage model bridges them by asking whether the SAST/DAST scan of the team's own code confirms or contradicts the dependency CVE's attack path assumptions.
Property 2: Supply chain attack surface. The supply chain attack surface is the number of unauthenticated package ingestion points in the dependency acquisition pipeline — the number of paths through which a malicious package could enter the dependency tree without review. The surface has three components. The ingestion component is determined by whether the team's dependency installation pipeline routes through an internal mirror or artifact registry that enforces review before packages are available for installation. A team that installs directly from public package registries — npmjs.org, PyPI, Maven Central — with no internal mirror has an ingestion point for every package published by any account on those registries, including newly-created accounts, compromised maintainer accounts, and typosquatted packages within edit distance 1 of well-known dependencies. An internal mirror narrows the ingestion point to the set of packages that have passed through the team's review process and been proxied into the internal registry — a package that has not been reviewed does not exist in the internal registry and cannot be installed, regardless of what the public registry offers. The provenance component is determined by whether the team verifies package provenance attestation before accepting a package. Sigstore cosign signatures and SLSA attestation data distinguish a build artifact produced by a known CI pipeline and signed by a known keypair from an artifact produced by an arbitrary process and published by an account with no attestation chain. A publisher change — the same package name published by a different account, as happened in the third failure pattern when the legitimate maintainer's account was compromised and a new version was published by the attacker — is detectable via attestation chain verification if previous versions were attested and the new version is not signed by the same keypair. Without attestation verification, publisher changes are invisible at install time. The scope component is determined by whether developer workstations share secrets with production. A developer workstation with AWS credentials pointing to production S3 buckets, database connection strings pointing to production databases, or service API keys that work in production extends the supply chain attack surface from the production deployment pipeline to any package installed on any developer's local machine. The malicious install script in the third failure pattern ran the same code in two execution environments — developer workstation and CI pipeline — and captured different sets of credentials from each; the production-credential exposure from the developer workstation was as consequential as the CI pipeline exposure, because the developer's local environment had been configured to allow direct production access for debugging convenience. Connect this to the CI/CD pipeline security decision record: CI/CD pipeline security covers the credentials, permissions, and secret injection model in the deployment pipeline itself; the supply chain attack surface's scope component interacts with the CI/CD security model in that a supply chain attack targeting the CI pipeline's install step has the same access to injected secrets as the pipeline's deployment steps — a package installed during npm ci in a GitHub Actions runner has access to every secret injected into that runner's environment, so the secret injection scope for the CI pipeline is the blast radius of a supply chain attack against that pipeline's dependency installation step.
The supply chain security ADR: five sections
Section 1: Dependency inventory model. The dependency inventory model defines how the team generates, stores, and queries a Software Bill of Materials for each service. Format choice: CycloneDX 1.4 JSON is the preferred SBOM format for teams whose primary use case is vulnerability response — the JSON format is queryable with standard tooling (jq, Python scripts, dedicated SBOM query tools), and the CycloneDX schema's vulnerability and component models are the most widely supported by CVE correlation tools including OWASP Dependency-Track, Grype, and Snyk. SPDX 2.3 is preferred when compliance requirements mandate SPDX (DoD SBOM requirements, some regulated-industry procurement processes); if SPDX is required for compliance, generate CycloneDX for operational use and SPDX for compliance reporting from the same toolchain. Generation trigger: generate the SBOM on every CI build from the production dependency manifest — not from the development dependencies, not from the devDependencies in package.json, only from the packages that are included in the production artifact. For services that use a bundler, generate from the bundler output rather than from the manifest to reflect tree-shaking and conditional imports. For containerized services, generate a container-image SBOM from the final production image using syft or grype to capture OS-level packages in addition to language-level dependencies. Storage: store the SBOM as a named build artifact keyed by service name, build SHA, and artifact type (application-level, container-image). Retain SBOM artifacts for 24 months — longer than the production lifetime of most deployments and long enough to answer "was service X using vulnerable-library Y at the time of incident Z?" questions during post-incident analysis. Queryability: ingest all SBOM artifacts into a central inventory (OWASP Dependency-Track is the reference implementation for teams without a commercial alternative) that provides a UI and API for cross-service queries. The minimum useful queries are: "which services use library X at versions matching range Y?" and "which services are affected by CVE identifier Z?" The first query is used at CVE response time; the second is used when a CVE scanner produces an alert that maps to a component. Connect to the dependency update policy decision record: the dependency update policy defines how frequently direct dependencies are updated and what the review process is for each update; the SBOM is the inventory that makes the dependency update policy auditable — the update policy says "update all direct dependencies monthly," and the SBOM diff between builds is the evidence that the policy was followed; the two decisions are upstream-downstream, with the SBOM providing the audit trail for the update policy's execution.
Section 2: Vulnerability response model. The vulnerability response model defines how the team triages CVEs against their specific implementation, sets response SLA tiers, and handles the cases where a fix is not available. Exploitability classification: when a high or critical CVE is published affecting a package in the team's inventory, the response begins with an exploitability assessment, not with an immediate patch obligation. The assessment answers four questions: (1) Is the vulnerable package present in the production runtime of any service (not just in devDependencies or build tooling)? (2) Is the described attack path reachable — meaning, does the team's code invoke the vulnerable code path in a way that exposes it to attacker-controlled input? (3) Are there compensating controls in the team's application code or infrastructure that prevent the attack path from being executed? (4) If the attack path is reachable and no compensating controls exist, what is the actual exploitability — does the attacker need to be authenticated? Do they need to be an admin? Do they need to be on the internal network? The assessment result is classified into one of four exploitability tiers: Tier 1 — reachable with no compensating controls, attackable by unauthenticated external actors (respond within 24 hours); Tier 2 — reachable with no compensating controls, attackable only by authenticated users or internal actors (respond within 7 days); Tier 3 — attack path exists but compensating controls prevent exploitation under current implementation (document exception, review within 30 days or when compensating controls change); Tier 4 — package present but attack path not reachable in current usage (document non-reachability, no patch obligation, monitor for implementation changes that could create reachability). Exception register: Tier 3 and Tier 4 assessments are stored in an exception register as first-class artifacts — not in a CI scanner's ignore file, but in a structured document that includes the CVE identifier, the exploitability tier, the specific compensating controls or non-reachability reasoning, the name of the engineer who performed the assessment, the date of the assessment, and the review condition (a specific configuration change, a new code path, or a date at which the exception must be re-evaluated). The exception register is reviewed quarterly alongside the SBOM inventory and whenever a service's authentication model, network topology, or application code handling the affected library changes. When no fix is available: for CVEs where the vulnerable package has not yet published a patched version, the response is to complete the exploitability assessment, classify into the appropriate tier, and document the fix-availability blocker in the exception register with a monitoring condition (re-evaluate when upstream publishes a patch). The assessment is not deferred until a fix is available — the exploitability tier is established immediately so that the team knows the urgency of monitoring for a patch.
Section 3: New dependency vetting model. The new dependency vetting model defines the review process for introducing a new direct dependency into any service's production dependency list. Trigger: any PR that adds a new entry to the production dependency list — package.json:dependencies, requirements.txt, go.mod, Cargo.toml without an existing entry — triggers the vetting review. Lockfile changes that update an existing dependency's version without introducing a new package do not trigger the vetting review (they are covered by the dependency update policy). Vetting criteria: five criteria must be assessed by the PR author and confirmed in the PR description. First, maintenance activity: the package must have had a commit or release in the last 12 months. A package with no activity in over a year is approaching unmaintained status; CVEs will not be patched and the package should not be introduced as a new dependency unless there is no alternative. Check the GitHub/GitLab repository and the package registry's publish history. Second, download volume: the package must have more than 1,000 weekly downloads on its registry OR must be from a known organization (a package published by the team's cloud provider, a database vendor, or a major open source foundation is acceptable regardless of download count). Low download count is not evidence of a supply chain threat, but it correlates with lower maintenance investment and less community scrutiny of the code. Third, license compatibility: the package's license must be compatible with the team's license policy (typically: MIT, Apache 2.0, BSD 2-clause, BSD 3-clause, ISC, Unlicense — permissive licenses only; GPL and AGPL require legal review before inclusion). Fourth, known vulnerabilities: the package must have no unresolved high or critical CVEs in the current version as reported by npm audit or the equivalent for the language ecosystem. If the latest version has known vulnerabilities and an older version does not, the vetting review must include a reason why the latest version is required. Fifth, transitive dependency footprint: the PR author must review the new package's direct dependencies (one level of transitive) and verify that no newly-introduced transitive dependency is from an account with no prior package publishing history (a newly-created account with a single package is an elevated risk signal). The footprint review is not required to be exhaustive beyond one level for most packages; packages with more than 20 direct dependencies or with a transitive tree deeper than 4 levels require an elevated review involving a second approver. Install script policy: any package that includes an install script in its package.json requires explicit approval from the security-designated reviewer (not just any PR reviewer) with documentation of the specific purpose of the install script. Connect to the vendor dependency governance decision record: vendor dependency governance covers the strategic decision about which vendors to accept operational dependencies on (data processing, billing, authentication, cloud infrastructure); the new-dependency vetting model covers tactical package introductions within the team's existing vendor relationships — a team that has an approved Stripe vendor relationship still needs to vet each individual Stripe SDK package introduction through the vetting process, because the vendor relationship is with Stripe Inc., not with every package that claims to be a Stripe utility library.
Section 4: Supply chain attestation model. The supply chain attestation model defines how the team verifies that packages in the dependency tree were produced by the processes and publishers claimed in the package metadata — not by a compromised account, a typosquatting campaign, or a dependency confusion attack. Internal mirror policy: all production dependency installations must route through the internal artifact registry (Verdaccio for Node.js, Artifactory or Nexus for multi-language environments). The internal registry is configured as a proxy cache for the public registries for approved packages and as a source of truth for internally-published packages. Direct installation from public registries bypassing the internal mirror is blocked at the network level for CI pipelines and policy-blocked for developer workstations via npm configuration enforcement (.npmrc with registry=https://registry.internal/ committed to the repository root). A package that is not yet in the internal mirror cache requires a vetting review (Section 3) to approve it before it can be pulled through the mirror into the internal cache. This converts the ingestion model from "any package on npmjs.org is installable" to "only packages that have been proxied through the mirror are installable" — without requiring a manual import for every package, since the mirror proxies automatically for packages that have already been approved, and blocks for packages that have not. Install script restriction: the CI pipeline and developer workstation tooling runs npm ci --ignore-scripts (or the equivalent for the language ecosystem) as the standard install command. Packages in the install-script exception whitelist — those whose legitimate functionality requires install scripts for native compilation or platform-specific binary selection — are listed in a repository-level configuration file with the package name, the script's purpose, and the reviewer who approved the exception. The exception whitelist is reviewed quarterly and whenever a package in the whitelist publishes a new version. Provenance attestation: for packages that support Sigstore cosign attestation (npm provenance attestation, available for packages published from GitHub Actions since 2023), the CI pipeline's dependency installation step verifies the provenance attestation for each attested package during install. Packages in the internal mirror that have attestation data from a prior version are flagged if a new version lacks attestation or carries attestation from a different signing keypair — this is the signal that caught the third failure pattern in the post-incident analysis and would have caught it in real time had the check been in place. For packages that do not support provenance attestation (the majority of the npm ecosystem), the internal mirror's proxy cache provides the ingestion control — a package that cannot be installed directly from the public registry cannot be substituted with a compromised version on the developer's workstation because the installation command always routes through the internal mirror, and the internal mirror serves the cached version that passed the original vetting review rather than the latest version on the public registry. Registry restriction enforcement: developer workstations are configured via a committed .npmrc that sets the registry to the internal mirror and sets audit=false (the audit command queries npmjs.org and the internal mirror configuration should be the source of truth for package provenance, not the public registry's advisory database). The .npmrc is committed to the repository root and enforced via a CI pre-check that fails the pipeline if the installed registry configuration deviates from the committed .npmrc. Connect to the API security decision record: API security covers authentication, authorization, and input validation for the team's own APIs; supply chain attestation covers the security of the third-party code that implements those API security controls — the JWT library, the OAuth library, the cryptographic primitives — and an attestation failure on a security-critical library is a supply chain attack targeting the team's authentication layer specifically, not just an abstract package quality concern.
Section 5: Measurement model. Four metrics that determine whether the supply chain security model is achieving its purpose. Metric 1 — mean time to impact assessment: the time from CVE publication to a completed exploitability assessment for every service in the production inventory. Measurement: for each CVE published affecting a package in the team's SBOM inventory, record the time from CVE publication to the first completed exploitability tier classification for each affected service. Target: 100% of high and critical CVEs affecting the production inventory receive a Tier classification within 72 hours of publication. The metric is measured at the point of "which services are affected and what tier are they" — not at the point of patch deployment, because the assessment is the upstream decision that determines whether emergency response is warranted. A team that cannot assess impact within 72 hours is operating without knowledge of their actual exposure: they do not know whether the CVE requires emergency response or a scheduled update, and that uncertainty is costlier than either outcome. Metric 2 — mean time to remediate by exploitability tier: the time from completed exploitability assessment to fix deployed for Tier 1 and Tier 2 CVEs. Measurement: for each CVE classified as Tier 1 or Tier 2, record the time from tier classification to production patch deployment. Target: Tier 1 — median remediation within 24 hours of classification, 95th percentile within 72 hours; Tier 2 — median remediation within 7 days, 95th percentile within 14 days. Tier 3 and Tier 4 CVEs are measured by exception register coverage (100% of Tier 3 and 4 assessments documented in the register within 72 hours) and exception staleness (no exception older than its review condition without a re-evaluation). Metric 3 — unapproved dependency introduction rate: the percentage of new direct dependencies introduced per quarter that did not follow the vetting process. Measurement: at the end of each quarter, compare the SBOM diff for each service against the new-dependency vetting record — packages that appear as new direct dependencies without a corresponding vetting review entry are unapproved introductions. Target: 0% unapproved introductions. The metric is not measuring whether the vetting process prevented bad packages; it is measuring whether the process was followed at all. A team with 15% unapproved introductions has a vetting process that is not being used as a gate — the friction of the process exceeds the perceived value, and engineers are bypassing it. The metric identifies the bypass rate. Metric 4 — install script exception register coverage: the percentage of packages in the dependency tree that include install scripts that are present in the install script exception whitelist with a documented review. Measurement: on each CI build, the pipeline compares the set of packages that include install scripts against the exception whitelist and fails if any install-script package is not in the whitelist. The metric is binary at the pipeline level (zero install-script packages outside the whitelist) but tracked as a trend — if the exception whitelist is growing at a rate of more than 2 entries per month, the team is accumulating technical debt in the exception register and should evaluate whether the packages driving the growth can be replaced with alternatives that do not require install scripts. Review the measurement model quarterly alongside the SBOM inventory, the exception register, and the new-dependency vetting record. Supply chain incidents and near-misses (a CVE that was classified as unexploitable but whose compensating control was subsequently removed, a package that passed vetting and later received a critical CVE) should be treated as calibration data for the measurement targets — if Tier 1 CVEs are consistently remediating in 48 hours rather than 24, adjust the target to reflect the team's actual capacity rather than maintaining a target that cannot be met.
FAQ
How do you handle a critical CVE in a transitive dependency when the fix requires the direct dependency to update first and the upstream maintainer is unresponsive?
A transitive vulnerability where the fix path runs through an unresponsive upstream maintainer creates a gap between the CVE's published severity and the team's ability to close it — the dependency resolution structure makes the team a bystander to the patch timeline. Four response options in ascending order of implementation cost. Option 1 — verify non-exploitability and document a formal exception: for many CVEs, the attack path is not reachable in the team's specific deployment context. If the exploitability assessment concludes the CVE is unexploitable in the current implementation, document the assessment in the exception register with the specific compensating controls that prevent exploitation, the signal that would indicate exploitability has changed (a new API endpoint that exposes the vulnerable code path, a configuration change that removes the compensating control), and a review date no more than 90 days out to re-evaluate whether the exception still holds. The exception is a first-class artifact, not an informal acknowledgment — stored in the dependency vetting record alongside the CVE identifier, the CVSS score, the exploitability assessment, and the name of the engineer who signed off. Option 2 — patch the transitive dependency directly using resolution overrides: most package managers support a mechanism to override the version of a transitive dependency regardless of what the direct dependency requests. npm's overrides field, Gradle's resolution strategy, Maven's dependencyManagement section, and Python pip's direct URL requirements all allow pinning a patched version of the transitive dependency even when the direct dependency has not updated its version range. Document the override in the exception register with the reason (CVE identifier), the override's expiry condition (when the direct dependency ships version X.Y.Z or higher), and a review ticket with a 90-day due date. Option 3 — replace the direct dependency with an alternative that does not include the vulnerable transitive: if the direct dependency has an actively maintained alternative that does not use the vulnerable transitive package, the migration cost may be lower than the ongoing maintenance cost of managing an override through multiple version bumps. The replacement should go through the standard new-dependency vetting process — the security urgency of the migration does not exempt it from the vetting criteria. Option 4 — fork and patch the direct dependency: for direct dependencies where no alternative exists, the upstream maintainer is unresponsive, and the override approach is structurally incompatible, the team can fork the direct dependency, apply the patch to its transitive dependency, publish the fork to the internal artifact registry, and reference the fork in the team's direct dependency list. This is the highest-cost option and should be reserved for cases where the CVE is genuinely exploitable, the direct dependency is deeply integrated, and no alternative exists. The fork creates a maintenance obligation to track upstream changes and periodically re-evaluate whether the upstream project has been revived, so the fork strategy includes a 6-month review condition and a process for returning to the upstream package when it becomes viable.
How do you structure SBOM generation and dependency inventory for a monorepo where many packages share a single root lockfile?
Monorepos create a specific SBOM challenge: the dependency tree is structurally unified at the lockfile level (a single package-lock.json or yarn.lock at the repository root), but the deployment units are independent (each service or package in the monorepo deploys separately and runs in its own container or execution environment). An SBOM that represents the entire monorepo's dependency tree conflates the dependency exposure of a lightweight API service with that of a heavy data-processing worker that uses dozens of additional libraries — producing false positives when a CVE affects a dependency used only by one deployment unit, and false negatives when the SBOM tool's coverage assumptions don't match the actual bundling configuration. Three approaches for SBOM generation in monorepos, in ascending order of accuracy. Approach 1 — per-workspace SBOM with workspace-level scoping: for monorepos using a workspace manager (npm workspaces, Yarn workspaces, pnpm workspaces, Turborepo, Nx), generate a separate SBOM for each workspace using the workspace's declared dependencies and the subset of the root lockfile that satisfies those dependencies. Tools like cdxgen with --package-type npm-workspace and spdx-tools with workspace-level traversal support this model. Each workspace SBOM represents the dependency tree for that deployment unit only, not the entire monorepo. Approach 2 — bundler-output SBOM: generate the SBOM from the bundler's output (the actual files included in the production artifact) rather than from the source dependency manifest. For services that use webpack, esbuild, or rollup, the bundler's dependency graph is the ground truth for what actually runs in production — it reflects tree-shaking, dead code elimination, and conditional imports that the manifest-based approach cannot capture. cyclonedx-webpack-plugin and similar tools operate on the production bundle rather than the source tree. Approach 3 — container-image SBOM: generate the SBOM from the production container image using syft or grype. This is the most complete approach and catches OS-level vulnerabilities (glibc CVEs, OpenSSL CVEs) that the application-level SBOM misses, but requires the container image to be built before the SBOM is generated. For monorepos, the practical approach is layered: per-workspace SBOMs provide fast per-PR feedback for CVE impact during development, and container-image SBOMs provide comprehensive pre-deployment validation as a final gate before production deployment. The SBOM inventory stores both: the per-workspace SBOM keyed by workspace name and commit SHA for in-development queries, and the container-image SBOM keyed by image tag and build SHA for production deployment queries.
What is the minimum viable supply chain security implementation for a team with zero existing controls and limited security bandwidth?
A team with zero existing supply chain controls should implement four specific controls in this order, stopping when the incremental cost exceeds the risk reduction for their current threat model. The order is determined by impact-per-implementation-hour, not by comprehensiveness. Control 1 — disable install scripts for new package installations: running npm ci --ignore-scripts (or the pip, cargo, gem equivalent) prevents the class of attack where a malicious package's postinstall hook executes arbitrary code at install time. This is the highest-impact, lowest-cost control available — it is a flag change to the install command, requires no infrastructure or tooling, and can be implemented in 10 minutes. The limitation: some legitimate packages require install scripts for native compilation (node-sass, bcrypt, canvas). For these packages, maintain an explicit whitelist that is reviewed at the same time as the package is vetted — the whitelist is the exception register for install script execution. Control 2 — add SBOM generation to CI and store the output: configure the CI pipeline to generate a machine-readable SBOM (CycloneDX JSON format) for each service on every build and store it as a build artifact keyed by service name and commit SHA. This addresses the 'which services are affected?' question for future CVEs — the moment a CVE is published, the team queries stored SBOMs rather than manually traversing lockfiles. cdxgen, syft, and trivy can be integrated as CI steps with a 10-minute setup. The benefit arrives at the moment of the first CVE requiring cross-service impact assessment. Control 3 — configure a dependency scanner with an exploitability override mechanism: install Dependabot, Snyk, or trivy in advisory mode with CI blocking, and configure a maximum CVSS threshold for automatic blocking plus an override mechanism where an engineer can annotate a CVE with a documented non-exploitability assessment and a review date, lifting the CI block for that CVE in that service. Without the override, engineers learn to route around the scanner rather than engage with it, and the scanner becomes security theater. The override is what makes the difference between a scanner that works and one that creates alert fatigue and bypass behavior. Control 4 — establish a lockfile commit policy that requires lockfile changes to be explicit in the PR description: require that any PR modifying a lockfile includes a human-readable description of which direct dependencies changed and why, separate from the application code change description. This creates a lightweight review gate for new dependency introductions without requiring a formal vetting process for every change — the reviewer's attention is explicitly drawn to lockfile changes rather than relying on them being noticed in the diff. These four controls address the most consequential supply chain risk categories — malicious install scripts, invisible transitive exposure, unqualified CVE blocking, and unreviewed dependency introductions — at a combined implementation cost of roughly one engineering day for a team starting from zero.
How do supply chain security decisions connect to AI chat sessions and decision preservation?
Supply chain security decisions are made in AI chat sessions when engineering leaders work through the incident post-mortem — why the dependency scanner did not catch the malicious package, what the vetting process should have included, and what the install-script policy should have been before the exfiltration was discovered — the security audit response — how to implement SBOM generation across all services, what format to use, how to store and query the inventory, and how to integrate the SBOM pipeline into existing CI/CD without blocking deployment velocity — and the CVE triage design — how to classify CVEs by exploitability context rather than raw CVSS score, what the response SLA tiers should be for each exploitability class, and how to implement an exception register that allows documented non-exploitability assessments without creating permanent ignore-list entries that outlive the compensating controls that justified them. The reasoning in those sessions is the substance of the supply chain security model — more so than the Snyk configuration file that records which severity level triggers a CI block, the dependabot.yml that records the update schedule, or the post-incident note that observes 'we should have had an internal mirror.' Running those AI chat sessions through the open-source extractor produces the supply chain security decision record that allows the next security engineer to understand why the SBOM format is CycloneDX rather than SPDX — because the incident response team could not find a tool that queried SPDX files across multiple services without custom scripting, and the pivot to CycloneDX happened in the third session after the first CVE response exercise revealed the query limitation — why the CVE triage model uses exploitability class rather than CVSS score as the response SLA determinant — because the CVSS 9.1 JWT library CVE blocked three days of deployments including an incident fix, and the post-incident analysis determined that the CVE was unexploitable in the team's specific authentication middleware but the CI scanner had no mechanism to represent that contextual fact — and why install scripts are disabled by default with a named-exception whitelist rather than disabled entirely — because the native compilation packages broke the CI build when install scripts were disabled without exceptions, and the exception list is the right model for the trust decision rather than a binary on/off policy that creates either false security or broken builds. Those reasoning sessions are what convert the dependabot.yml configuration from a maintenance artifact into a durable security decision record — and they exist in the AI chat history of the engineers who designed the supply chain controls, not in the CI configuration that records only the thresholds and flags that survived the last policy revision.
Further reading
- CI/CD pipeline security decision record — CI/CD pipeline security covers the credentials, permissions, and secret injection model in the deployment pipeline itself; the supply chain security model's scope component interacts directly with the pipeline security model in that a supply chain attack targeting the CI pipeline's install step has the same access to injected secrets as the pipeline's deployment steps — a package installed during
npm ciin a GitHub Actions runner accesses every secret injected into that runner's environment, so the secret injection scope for the CI pipeline is the blast radius of a supply chain attack against that pipeline's dependency installation step; the two ADRs should be reviewed together and the credential scoping decisions in the CI/CD security record should explicitly account for the supply chain attack surface's scope component. - Security scanning decision record — SAST/DAST scanners and dependency scanners serve different functions — SAST/DAST identifies vulnerabilities in code the team wrote; dependency scanners identify vulnerabilities in code the team imported; the exploitability triage model for dependency CVEs must account for the same application-layer compensating controls that SAST/DAST scanning is designed to verify — an authentication layer that the SAST scanner confirms rejects the input class required by a dependency CVE's attack path is exactly the compensating control that determines whether the CVE is classified as Tier 1 or Tier 3; the two scanners are upstream-downstream of each other, and the triage model bridges them by asking whether the SAST/DAST scan of the team's own code confirms or contradicts the dependency CVE's attack path assumptions.
- Dependency update policy decision record — the dependency update policy defines how frequently direct dependencies are updated and what the review process is for each update; the supply chain security model's SBOM and new-dependency vetting processes interact with the update policy in that a team updating dependencies monthly without a vetting gate for version bumps may inadvertently introduce a supply chain compromise through a compromised package version — the update policy's velocity creates the ingestion frequency, and the attestation model's provenance verification should apply at each update event, not only at initial package introduction; the measurement model for both should be reviewed together since the MTTR for high-priority CVEs is bounded by the update policy's implementation cadence.
- Vendor dependency governance decision record — vendor dependency governance covers the strategic decision about which vendors to accept operational dependencies on (data processing, billing, authentication, cloud infrastructure); the new-dependency vetting model covers tactical package introductions within the team's existing vendor relationships — a team that has an approved Stripe vendor relationship still needs to vet each individual Stripe SDK package introduction through the vetting process, because the vendor relationship is with Stripe Inc., not with every package that claims affiliation with Stripe; the distinction between vendor approval and package approval is the boundary between the two ADRs, and supply chain attacks often exploit this gap by using legitimate vendor names as package name prefixes to bypass informal trust heuristics.
- API security decision record — API security covers authentication, authorization, and input validation for the team's own APIs; supply chain attestation covers the security of the third-party code that implements those API security controls — the JWT library, the OAuth library, the cryptographic primitives — and an attestation failure on a security-critical library is a supply chain attack targeting the team's authentication layer specifically; the JWT verification exploit in the second failure pattern was a dependency CVE whose exploitability depended entirely on how the team's own API code called the JWT library — which is a question the API security ADR's authentication model answers, and the supply chain security ADR's exploitability triage model must consult to reach its tier classification.
- Open-source extractor — the reasoning behind supply chain security decisions — why the SBOM format is CycloneDX rather than SPDX, why the CVE triage model uses exploitability class rather than CVSS score, why install scripts are disabled by default with a named-exception whitelist, why the internal mirror policy applies to developer workstations in addition to CI pipelines — is reasoning conducted in AI chat sessions during post-incident analysis, security audit responses, and policy design; it does not survive into the dependabot.yml configuration, the Snyk severity threshold setting, or the CI flag that enables or disables install scripts; running those sessions through the extractor produces the supply chain security decision record that allows the next security engineer to inherit the reasoning rather than inheriting a CI configuration that blocks deploys on CVSS 7.5 with no context for why that threshold was chosen after the incident that made the implicit explicit.