Skip to content
Misconfiguration Write-up Intermediate

Bypassing Container Image Scanning

The write-up shows that container image scanners can be fooled by altering the image itself, for example by deleting the package manager's state file or removing the package manager, so a scan reports zero vulnerabilities while vulnerable packages remain installed. An attacker who can influence an image build could therefore get a vulnerable or malicious image past a CI/CD policy that relies on scan results.

Joshua Stuts Follow

Published on infosecwriteups.com

Container technology has become the backbone of modern computing. Most modern companies are now running containers in production environments, and many have successfully built container image scanning into their CI/CD pipelines.

Joshua Stuts, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the scanners trust data that lives inside the image being scanned (package manager state files, the package manager binary itself, or file signatures), so anyone who controls the image build can remove or alter that data.

Impact

Images that still contain vulnerable packages or malware could pass a scan with zero findings and be deployed under a policy that trusts those results.

What the attacker needed

Control over the image build; scanner relies on in-image data

The fix

Scanners should not rely solely on in-image data; they should verify package inventories independently and teams should know their tooling and image inventory.

How it was found

  1. Add a command to the image's Dockerfile that deletes the package manager state file.
  2. Build the modified image and compare its scan result with the unmodified base image.
  3. For runtime scanners, remove the package manager after installing packages so the scanner cannot query it.
  4. For scanners that inject a binary at a known path, create a symlink to /dev/null at that path before the binary is written.
  5. For file-based scanners, change file signatures, names or extensions of vulnerable components.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A container image is a packaged bundle of an application and everything it needs to run, including installed software libraries. Companies scan these images to look for known-bad versions of software before deploying them. This article shows that many scanners only read a list of installed software, so if you delete or hide that list, the scanner sees nothing and reports the image as clean even though the risky software is still there.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Joshua Stuts

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.