OCImendby CloudTrace

Base image or your layers? Finding which Dockerfile step introduced a CVE

OCImend · 2026-09-26

Short answer

Each image layer is a build step. Mapping every vulnerable package to the first layer that contains its files shows whether it came from the base image (rebuild on a newer base) or from your own RUN / COPY instructions (edit your Dockerfile).

LayerBuild stepOwnerFix
1FROM debian:trixiebase publishernewer base tag
2apt-get install … build toolsbase publishera -slim variant
5RUN pip install -r requirements.txtyoubump the dependency
6COPY app/yourebuild

Measured on python:latest: 81 of its 109 findings rated low or above come from one apt-get install step in the base image.

Two fix plans

  1. 01Base layersrebuild on a newer or slimmer base
  2. 02Your layerschange the Dockerfile step

83 % of security leaders name outdated base images as the root cause of their latest container vulnerabilities. Knowing the split ends the argument over who fixes what.

See where your CVEs come from →

Questions

How is the base image detected?
By matching the image's first layers to the longest known chain of layers of another public image.

Sources

More guides