CVE-2024-24557 Moby classic builder cache poisoning

Medium 6.9 Published Updated

Attackers can poison the classic builder cache to inject malicious code into container builds, affecting users who disable BuildKit or use older versions.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-24557?

CVE-2024-24557 is a medium-severity vulnerability in moby, published on 1 Feb 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

Moby is an open-source project created by Docker to enable software containerization. The classic builder cache system is prone to cache poisoning if the image is built FROM scratch. Also, changes to some instructions (most important being HEALTHCHECK and ONBUILD) would not cause a cache miss. An attacker with the knowledge of the Dockerfile someone is using could poison their cache by making them pull a specially crafted image that would be considered as a valid cache candidate for some build steps. 23.0+ users are only affected if they explicitly opted out of Buildkit (DOCKER_BUILDKIT=0 environment variable) or are using the /build API endpoint. All users on versions older than 23.0 could be impacted. Image build API endpoint (/build) and ImageBuild function from github.com/docker/docker/client is also affected as it the uses classic builder by default. Patches are included in 24.0.9 and 25.0.2 releases.

Weakness: CWE-346, CWE-345

Which versions are affected by CVE-2024-24557?

10 open source packages ship an affected version, including github.com/moby/moby and github.com/docker/docker. It affects 1 product.

PackageAffectedFixed in
github.com/moby/moby GoAll versions24.0.9+incompatible, 25.0.2+incompatible
github.com/moby/moby GoAll versions24.0.9
github.com/moby/moby GoAll versions24.0.9
github.com/moby/moby GoFrom 25.0.025.0.2
github.com/moby/moby GoFrom 25.0.025.0.2
github.com/docker/docker GoAll versions24.0.9+incompatible, 25.0.2+incompatible
4 more packages
github.com/docker/docker GoAll versions24.0.9
github.com/docker/docker GoAll versions24.0.9
github.com/docker/docker GoFrom 25.0.025.0.2
github.com/docker/docker GoFrom 25.0.025.0.2
Linux distribution packages (1)
forgejo-runner openSUSE:TumbleweedAll versions3.5.1-1.1

Products include Mobyproject Moby.

How do I fix CVE-2024-24557?

Upgrade github.com/moby/moby to a fixed version for your release line: 24.0.9+incompatible, 25.0.2+incompatible, 24.0.9 or 25.0.2.

Is CVE-2024-24557 being exploited?

There is no known exploitation of CVE-2024-24557 in the wild and no public exploit code.

Sources

Also known as AZL-34275, AZL-35002, BELL-CVE-2024-24557, CLEANSTART-2026-HP60657, CLEANSTART-2026-PY60272, CLEANSTART-2026-QF32596 and 10 more.

Is CVE-2024-24557 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free