Software Supply-Chain Security for Web Builds

Software Supply-Chain Security for Web Builds

A modern site runs code that the team that ships it did not write. The supply chain as a primary attack surface: the chain end to end, distinct controls, what to fund first.

A modern enterprise site runs code that the team that ships it did not write — it arrived through dependencies, a build pipeline, and code the browser fetches directly, and any one of those is a path into the pages that load the code it contributes. The controls are three distinct things, not one idea: pinning what you depend on, integrity-checking what the browser loads, and provenance for what your build produced. An SBOM is not paperwork; it is an artifact that a customer security review and a breach investigation can both draw on. For a site untouched in three years the funding order is inventory before policy, because you cannot secure a dependency you have not listed.

Why the supply chain became a primary surface

There is an uncomfortable accounting exercise every CTO should run once: estimate what fraction of the code executing on your site your own team actually wrote and reviewed. For a typical enterprise web build the honest answer is uncomfortable. Open source is close to universal: Black Duck's 2026 Open Source Security and Risk Analysis (OSSRA) report found open source in 98% of the codebases it audited. Around the authored code sit dependencies, their dependencies, build tooling, and code the browser fetches at runtime from elsewhere. A threat model that scrutinizes the authored code and treats the imported code as background is auditing only part of the surface and reporting it as the whole.

This is not a statement about code quality. The imported code is often better-reviewed than the authored code. The point is structural: every one of those dependencies, and every step of the build that assembles them, is a path into every page that loads the code it contributes. A compromise does not need to find a flaw in your application logic. It needs to find one link — a single poisoned package deep in the graph, a single tampered build step — and that link inherits the trust the whole site extends to its own code.

The trust is the part that makes this different from an ordinary vulnerability, and it is worth being precise about. When a team adds a dependency it makes a transitive decision it never actually sees: it trusts that package, and implicitly every package that one depends on, and every package those depend on, down a graph that is often far larger than the manifest suggests and that no human on the team has read. A flaw in your own code is bounded by what your code does. A malicious node deep in that graph runs with exactly the privileges the legitimate code around it runs with, on every page that transitively pulls it, and it arrived through a decision the team experienced as one line in a manifest. The attack surface is not the dependency you chose; it is the closure of everything that choice silently committed you to. The industry's shared risk list now reflects this: the OWASP Top 10:2025 carries Software Supply Chain Failures as its own category (A03:2025).

A site that has not been rebuilt in three years can carry this surface in its most dangerous form: unaudited, unpinned, and unprovenanced. Unaudited, because nobody has inventoried what is actually in the graph since launch. Unpinned, if the build installs from version ranges without a committed lockfile, so that it resolves to whatever a dependency offered most recently rather than to a version someone vetted. Unprovenanced, because there is no record of what produced the artifact now in production, only the assumption that it was the build. None of this shows up in normal operation. It shows up when the link is pulled.

The chain, end to end

One way supply-chain security goes wrong is that teams treat it as one control — "we scan dependencies" — when it is a chain of distinct stages, each with its own risk, its own control, and its own owner. Collapsing them into a single idea makes the missing controls invisible, because "we scan dependencies" sounds like coverage.

StageThe riskThe controlThe owner
DependencyA package or a transitive dependency is malicious or vulnerableInventory and pin known-good versions; do not float to latestEngineering
BuildA compromised build step injects code into an otherwise clean artifactProvenance: a verifiable record of what produced this artifactEngineering / DevSecOps
DeliveryCode the browser fetches directly is swapped or tampered after buildSubresource integrity: with an integrity attribute on the tag (and, for cross-origin files, CORS plus a crossorigin attribute on the tag), the browser refuses code that does not match its expected hashFrontend / platform

Read down that table and the three controls are clearly not one idea. Pinning addresses the dependency stage: it makes dependency resolution repeatable, one precondition for a reproducible build, and refuses silent version drift, so the code you reviewed is the code that ships. Provenance addresses the build stage: it answers "what actually produced this artifact" with evidence rather than trust-by-default, which is precisely the question a tampered pipeline is designed to make you assume away. The framework that formalizes build provenance as graded levels is SLSA, and its existence as an industry-consensus framework is itself a signal that "the build is fine because it is our build" is a weak answer to give a serious review. Subresource integrity addresses the delivery stage: for code the browser pulls directly from somewhere else, an integrity attribute on the script or stylesheet tag lets the browser verify it against an expected hash and refuse it if it changed — provided the host serves the file with CORS and the tag carries a crossorigin attribute, both of which SRI requires for cross-origin files — a mechanism documented in MDN's subresource integrity reference. That mechanism has a hard limit worth stating plainly: it only fits files whose content is fixed. A third-party script that its provider updates in place at the same URL will fail the check every time it changes, so for that kind of code integrity hashes are not a workable control, and the realistic options are serving a pinned copy you control, constraining the script through the content policy, or isolating it. Three stages, three controls, three owners — and a posture that has only one of them has two open stages it cannot see.

SBOM and provenance as enterprise assurance

A software bill of materials is easily mis-sold internally as compliance paperwork, and framed that way it gets deprioritized. Reframe it correctly and it is funded faster: an SBOM is an artifact that two very different, very expensive moments can both draw on, and neither of them can wait until the moment arrives.

The first moment is a customer security review. An enterprise buyer's procurement process can ask what is in the software they are about to depend on, and "we'll get back to you" is an answer that can stall the deal in legal review. The second moment is an incident. When a widely-used package is disclosed as compromised, the first question that matters is "are we exposed, and where," and a team without an inventory answers it by reading source under pressure while the clock runs.

The asymmetry between those two states is the whole argument for funding the artifact early. A team with a current SBOM can answer the incident question with a query, scope the blast radius accurately, and communicate a precise status to customers while the story is still forming. A team without one spends the early part of the response establishing what it even has, produces an answer it cannot fully stand behind, and communicates uncertainty during exactly the window when uncertainty is most expensive — and it does this while a competitor with the artifact may already be past the question. The CISA SBOM resource describes an SBOM as a nested inventory of software components and promotes it as a transparency tool; the operational point is blunter: an SBOM for what is already in production is hard to reconstruct quickly once you need it, which is why it is generated before you need it.

Provenance is the SBOM's structural partner. The SBOM says what is in the artifact; provenance says what produced it and, when it is signed by a hosted build platform and verified, gives evidence that the artifact in production is the one the trusted build emitted, not one substituted along the way. Together they replace trust-by-default — "it is our build, so it is fine" — with verifiable assurance, which is the kind a demanding review and an incident investigation can rely on. The continuous mechanics of detecting a vulnerable dependency in the graph, and where that detection sits in the build, are covered by a dedicated article on this topic on the build pipeline, and the surface of marketing-injected third-party code is covered by a separate article on tag governance; for the detection itself, software composition analysis tools such as OWASP Dependency-Check scan a project's dependencies for publicly known vulnerabilities. This article covers the posture: the chain has stages, the stages have distinct controls, and the assurance artifacts are not optional.

What a CTO funds first

The supply chain looks unbounded from the outside, which is why it is often funded last or not at all — there is no obvious first move. There is one. The order is inventory before policy, always, because a policy that governs an unlisted dependency governs nothing.

Inventory first. You cannot pin, integrity-check, or risk-rank a dependency you have not enumerated, and you cannot tell a customer or an incident responder what you are exposed to if you do not know what is in the graph. The inventory is unglamorous and it is the prerequisite for every other control; funded out of order, the other controls protect a surface whose edges you cannot see.

This ordering failure is worth naming as a pattern, because it does not look like a failure while it is happening. A team buys scanning, wires it into the build, and reports coverage — and the report is true for the dependencies the scanner knows to look at. What it does not surface is the code outside that view: a directly-fetched browser script a manifest-based scanner does not see, a build step that runs before the scan, a transitive package the manifest does not pin so the scanner checks a version that is not the one production resolves to. Every one of those is a real path, and the green report makes them invisible by implying the question is already answered. An inventory is what converts "we scan dependencies" from a comforting sentence into a bounded, checkable claim, which is precisely why it has to come before the policy that points at it.

Then the highest-leverage controls, not the easiest ones. Integrity on the code the browser fetches directly is high leverage because that stage is both exposed and externally tamperable, and for the fixed files it can cover the control is comparatively contained; scripts that change in place need the alternatives described above. Provenance on the build is high leverage because the build is the single chokepoint every artifact passes through, so verifying it covers the whole output rather than one dependency at a time. The continuous-integration mechanics — where scanners run, how gates wire into the pipeline — are deferred to the pipeline article deliberately, because that is implementation and it rots faster than the posture does. The CTO-altitude decision is narrower and more durable: the supply chain is a primary surface, it has an inventory you fund before any policy, and integrity and provenance are the controls you buy before the cosmetic ones, regardless of which is easier to schedule.

Project Inquiry