How to fix CVEs in Debian container images
Short answer
Debian-based images are fixed by apt-get upgrade from the security repository of a supported release. Many reported Debian CVEs have no fix because the Debian security team rated them minor or postponed them; those are reported as no fix yet, not as something an upgrade can change. Use the slim variant and a supported release.
Fix a Debian image now →
free, no sign-up; pre-filled with debian:12-slim, change it to yours
The steps
- 01apt-get upgradeFixes from the security repository of your release.
- 02Slim variantFewer packages, fewer CVEs.
- 03Supported releaseOld releases move to the archive and stop receiving fixes.
- 04Read 'no fix' correctlyPostponed or minor issues have no fixed package to upgrade to.
By hand
FROM debian:12-slim RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
Then rescan: the CVEs that remain are either without a released fix or in code the application never loads (the report marks both).
Traps that bring CVEs back
- A large share of Debian CVEs are marked no fix: hardening (removing unused packages) is the way out.
- Images built long ago keep old packages until rebuilt: rebuild regularly or let OCImend watch them.
Debian images in OCImend's reports
| Image | Grade | Known CVEs | |
|---|---|---|---|
| debian:bookworm-20261123 | B | 48 | Fix |
| gcr.io/distroless/static-debian12:nonroot | A | 0 | Fix |
| gcr.io/distroless/base-debian12:latest | A | 3 | Fix |
Questions
How do I fix CVEs in a Debian container image?
Debian-based images are fixed by apt-get upgrade from the security repository of a supported release. Many reported Debian CVEs have no fix because the Debian security team rated them minor or postponed them; those are reported as no fix yet, not as something an upgrade can change. Use the slim variant and a supported release.
Why does Debian show so many CVEs with no fix?
The security team publishes fixes for issues it rates important; minor ones are postponed. They remain listed until fixed upstream.
Is debian:12-slim enough for production?
For most apps yes, once patched.
Other image types
Python · Node.js · Java · Go · nginx · PostgreSQL · Alpine · Ubuntu · Red Hat UBI