Where Your CVEs Actually Live: Base Image, OS Packages, or Your Dependencies?

Key takeaways
- Container findings come from three distinct layers — base image, runtime, and application dependencies — and each has a different fix and a different owner.
- Base image findings are usually the cheapest to resolve, because one rebuild clears the same finding across every service sharing that base.
- Dependency findings are where remediation stalls, since upgrading is often unavailable in pinned or certified estates.
- A scan count is a triage input, not a risk measure. It cannot see reachability, backports, or whether a component runs at all.
- Attribute findings by layer before setting any target. A single blended number guarantees the hardest layer blocks the easiest.
Most container findings come from software nobody on the team chose directly: the distribution packages inherited from a base image, and the transitive dependencies pulled in by the libraries that were chosen. Your own code is rarely the largest contributor to the number. Knowing which of the three layers a finding belongs to determines which remediation actually works, because the fix for one layer does nothing for the other two.
Teams that stall on vulnerability reduction usually have not made this split. They run one number, negotiate it as one problem, and try to solve it with one tool.
The three layers produce findings that look identical and behave differently
A scan report is a flat list. The underlying estate is not. Separating the list into layers is the first analytical step, and it is usually the one that reframes the conversation.
| Layer | What it contains | Who chose it | What actually fixes it |
|---|---|---|---|
| Base image | Distro OS packages, shell, package manager, locales | Whoever wrote the first FROM line | Rebuild on a patched or smaller base |
| Language runtime | Interpreter or JVM and its bundled libraries | Platform or app team | Runtime version bump, or a patched runtime build |
| Application dependencies | Direct and transitive packages from npm, PyPI, Maven, NuGet | App team, mostly indirectly | Dependency upgrade, backported fix, or removal |
The practical consequence is that a base image swap and a dependency upgrade are different projects with different owners, different risk profiles and different calendars. Reporting them as one metric guarantees that whichever is harder blocks the one that is easy.
Why the base image layer is usually the cheapest win
Base image findings concentrate. Many services inherit from a handful of bases, so one rebuild resolves the same finding across every service that shares it. Nothing in the application changes, which keeps regression risk low and review cheap.
Two structural facts drive the volume here:
- Most of what a general-purpose base image contains is never executed by the workload. A shell, a package manager and a full locale set are present because the image is general-purpose, not because the service needs them.
- Every one of those packages is in scope for a scanner, whether or not the code path is reachable. Attack surface and finding count both scale with content that earns nothing.
This is the mechanism behind minimal and hardened bases, and it is also why the reduction is sometimes dramatic and sometimes negligible. If your findings are concentrated in application dependencies, shrinking the base changes little. Measure before assuming. Our breakdown of the hidden risk in Docker base images covers what accumulates in a default base and why.
The dependency layer is where upgrades stop being available
Application dependencies behave differently, and this is where remediation programmes genuinely get stuck. The standard advice — upgrade to a fixed version — assumes upgrading is available. In a large share of production estates it is not: a component is pinned to satisfy a compatibility matrix, a vendor certification, or a transitive dependency that will not move.
When that happens, teams face a narrow set of real options:
- Upgrade anyway and absorb the regression risk and test burden.
- Apply a backported fix, keeping the version and changing the contents.
- Remove the dependency, which is occasionally the correct answer and rarely the fast one.
- Accept the risk formally, with a documented justification and a review date.
Backporting is the option most often missed, and it has a specific side effect worth knowing before you adopt it: a patched package keeps its original version string, so a version-matching scanner keeps reporting the vulnerability as present. The honest fix is a machine-readable exploitability statement travelling with the artifact rather than a suppression buried in one team's scanner configuration.
What container vulnerability scanning tells you and what it leaves out
A scanner answers one question well: which known vulnerability records match the components it can identify. That is genuinely useful and it is also narrower than the number it produces implies.
What a scan does not establish:
- Whether the affected code path is present or reachable in your configuration.
- Whether a fix was backported, since matching is usually by version string.
- Which layer a finding came from, unless you deliberately attribute it.
- Whether the component is used at runtime at all, as opposed to merely installed.
None of this makes scanning optional — it is the only practical inventory of known issues at scale. It means the raw count is a starting point for triage rather than a measure of risk. Container scanning best practices covers how to configure that triage so the number means something.
How to attribute findings by layer in a week
This is a reporting change, not a tooling purchase, and it is usually achievable with what you already run.
- Scan the base image alone, then the built image. The difference is everything your build added.
- Tag each finding with its source layer in whatever system holds them, and never report a single blended total again.
- Rank layers by findings-per-unit-of-effort, not by raw count. A hundred base findings fixed by one rebuild beat ten dependency findings each needing a compatibility review.
- Pick the pilot service for its pain, not its enthusiasm. Only the hard case produces evidence that persuades the rest of the organisation.
- Re-baseline after the first base image change before promising anything about the dependency layer, because the remaining profile will look different.
The output is a per-layer burndown with a named owner per layer. That is the artifact that turns a stalled vulnerability programme into three tractable ones.
FAQs
Which layer usually produces the most findings?
For a service built on a general-purpose base image, distribution packages typically dominate the raw count, because a full base carries a large body of software the workload never executes. For a dependency-heavy application on an already-minimal base, the application layer dominates instead. The ratio varies enough between estates that the only reliable answer comes from scanning the base and the built image separately and comparing.
Does a minimal base image always cut the count significantly?
No, and expecting it to is a common disappointment. A minimal base removes findings that came from content the workload did not need — shells, package managers, unused libraries. If your findings are concentrated in application dependencies, that reduction is small. Measure the split first. The base change is still worth making for attack surface reasons, but size the expected benefit honestly.
How should we handle a CVE we cannot upgrade away from?
Four options exist: upgrade and absorb the risk, apply a backported fix that keeps the version, remove the dependency, or formally accept the risk with a justification and review date. Backporting resolves the deadlock most often in pinned estates. Whichever you choose, record the decision somewhere downstream consumers can see rather than suppressing the finding in a local scanner configuration.
Why does our scanner still flag something we patched?
Almost always because the patch was backported. Scanners identify vulnerabilities by matching installed package version strings against a vulnerability database, and a backported fix changes a package's contents without changing its version. The resolution is a machine-readable exploitability statement declaring that build unaffected, supported by an SBOM a consumer can verify independently.
Should we track one vulnerability number or three?
Three, with one owner each. A blended total hides which layer is moving and lets the hardest layer block progress on the easiest. Per-layer tracking also makes the trade-offs legible to people outside the team: a base image rebuild is a platform decision, a dependency upgrade is an application decision, and conflating them puts the argument in the wrong room.
Frontier models can now find and exploit zero days in your code
Find out what to do when there's no CVE, scanner alert or fix available yet.
What are the 7 blind spots in your vulnerability scans?
Discover when "0 vulnerabilities" doesn't actually mean you're clean.





.avif)