CVE-2024-24557 Moby classic builder cache poisoning
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.
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.
| Package | Affected | Fixed in |
|---|---|---|
github.com/moby/moby Go | All versions | 24.0.9+incompatible, 25.0.2+incompatible |
github.com/moby/moby Go | All versions | 24.0.9 |
github.com/moby/moby Go | All versions | 24.0.9 |
github.com/moby/moby Go | From 25.0.0 | 25.0.2 |
github.com/moby/moby Go | From 25.0.0 | 25.0.2 |
github.com/docker/docker Go | All versions | 24.0.9+incompatible, 25.0.2+incompatible |
4 more packages
github.com/docker/docker Go | All versions | 24.0.9 |
github.com/docker/docker Go | All versions | 24.0.9 |
github.com/docker/docker Go | From 25.0.0 | 25.0.2 |
github.com/docker/docker Go | From 25.0.0 | 25.0.2 |
Linux distribution packages (1)
forgejo-runner openSUSE:Tumbleweed | All versions | 3.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.
Other vulnerabilities in moby
- CVE-2024-36623 Moby Race Condition vulnerability
- CVE-2023-28840 moby/moby's dockerd daemon encrypted overlay network may be unauthenticated
- CVE-2018-12608 Docker Authentication Bypass
- CVE-2023-28841 moby/moby's dockerd daemon encrypted overlay network traffic may be unencrypted
- CVE-2023-28842 moby/moby's dockerd daemon encrypted overlay network with a single endpoint is unauthenticated
Sources
Also known as AZL-34275, AZL-35002, BELL-CVE-2024-24557, CLEANSTART-2026-HP60657, CLEANSTART-2026-PY60272, CLEANSTART-2026-QF32596 and 10 more.