{"id":"CVE-2024-24557","aliases":["CVE-2024-24557","GHSA-xw73-rw38-6vjc","GO-2024-2512"],"related":["CGA-84m3-g3p3-gw6w"],"kind":"vulnerability","state":"published","title":"Moby classic builder cache poisoning","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"The classic builder cache system is prone to cache poisoning if the image is built `FROM scratch`.\nAlso, changes to some instructions (most important being `HEALTHCHECK` and `ONBUILD`) would not cause a cache miss.\n\n\nAn 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.\n\nFor example, an attacker could create an image that is considered as a valid cache candidate for:\n```\nFROM scratch\nMAINTAINER Pawel\n```\n\nwhen in fact the malicious image used as a cache would be an image built from a different Dockerfile.\n\nIn the second case, the attacker could for example substitute a different `HEALTCHECK` command.\n\n\n### Impact\n\n23.0+ users are only affected if they explicitly opted out of Buildkit (`DOCKER_BUILDKIT=0` environment variable) or are using the `/build` API endpoint (which uses the classic builder by default).\n\nAll users on versions older than 23.0 could be impacted. An example could be a CI with a shared cache, or just a regular Docker user pulling a malicious image due to misspelling/typosquatting.\n\nImage build API endpoint (`/build`) and `ImageBuild` function from `github.com/docker/docker/client` is also affected as it the uses classic builder by default. \n\n\n### Patches\n\nPatches are included in Moby releases:\n\n- v25.0.2\n- v24.0.9\n- v23.0.10\n\n### Workarounds\n\n- Use `--no-cache` or use Buildkit if possible (`DOCKER_BUILDKIT=1`, it's default on 23.0+ assuming that the buildx plugin is installed).\n- Use `Version = types.BuilderBuildKit` or `NoCache = true` in `ImageBuildOptions` for `ImageBuild` call.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Classic builder cache poisoning in github.com/docker/docker","format":"markdown","source":"go"},{"lang":"es","text":"Moby es un proyecto de código abierto creado por Docker para permitir la contenedorización de software. El sistema de caché del constructor clásico es propenso a envenenar el caché si la imagen se crea DESDE scratch. Además, los cambios en algunas instrucciones (las más importantes son HEALTHCHECK y ONBUILD) no provocarían una pérdida de caché. Un atacante con conocimiento del Dockerfile que alguien está usando podría envenenar su caché al obligarlo a extraer una imagen especialmente manipulada que se consideraría como un candidato de caché válido para algunos pasos de compilación. Los usuarios de 23.0+ solo se ven afectados si optaron explícitamente por no participar en Buildkit (variable de entorno DOCKER_BUILDKIT=0) o si están usando el endpoint API /build. Todos los usuarios con versiones anteriores a la 23.0 podrían verse afectados. El punto final de la API de creación de imágenes (/build) y la función ImageBuild de github.com/docker/docker/client también se ven afectados ya que utiliza el generador clásico de forma predeterminada. Los parches se incluyen en las versiones 24.0.9 y 25.0.2.","source":"nvd"}],"published":"2024-02-01T16:26:29.685Z","modified":"2026-09-10T03:50:00.315Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:L","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:L","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:L","score":6.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-345","CWE-346"],"affected":[{"ranges":[{"version":">= 25.0.0, < 25.0.2","status":"affected"},{"version":" < 24.0.9","status":"affected"}],"vendor":"moby","product":"moby","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"24.0.9"}],"ecosystem":"Go","package":"github.com/docker/docker","purl":"pkg:golang/github.com/docker/docker","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"24.0.9"}],"ecosystem":"Go","package":"github.com/moby/moby","purl":"pkg:golang/github.com/moby/moby","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"25.0.0","status":"affected","fixed":"25.0.2"}],"ecosystem":"Go","package":"github.com/moby/moby","purl":"pkg:golang/github.com/moby/moby","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"25.0.0","status":"affected","fixed":"25.0.2"}],"ecosystem":"Go","package":"github.com/docker/docker","purl":"pkg:golang/github.com/docker/docker","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"24.0.9+incompatible"},{"type":"semver","introduced":"25.0.0+incompatible","status":"affected","fixed":"25.0.2+incompatible"}],"ecosystem":"Go","package":"github.com/docker/docker","purl":"pkg:golang/github.com/docker/docker","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"24.0.9+incompatible"},{"type":"semver","introduced":"25.0.0+incompatible","status":"affected","fixed":"25.0.2+incompatible"}],"ecosystem":"Go","package":"github.com/moby/moby","purl":"pkg:golang/github.com/moby/moby","source":"go"},{"ranges":[{"status":"affected","fixed":"24.0.9"},{"status":"affected","introduced":"25.0.0","fixed":"25.0.2"}],"vendor":"mobyproject","product":"moby","cpe":"cpe:2.3:a:mobyproject:moby:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/moby/moby/security/advisories/GHSA-xw73-rw38-6vjc","tags":["advisory","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/moby/moby/commit/3e230cfdcc989dc524882f6579f9e0dac77400ae","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-24557","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/moby/moby/commit/fca702de7f71362c8d103073c7e4a1d0a467fadd","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/moby/moby/commit/fce6e0ca9bc000888de3daa157af14fa41fcd0ff","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/moby/moby","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-05-15T15:20:50.514Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-24557","url":"https://www.cve.org/CVERecord?id=CVE-2024-24557","licence":"CVE Terms of Use","modified":"2025-05-15T15:27:27.082Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xw73-rw38-6vjc","url":"https://github.com/advisories/GHSA-xw73-rw38-6vjc","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:00.315Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-2512","url":"https://pkg.go.dev/vuln/GO-2024-2512","licence":"CC-BY-4.0","modified":"2026-02-04T04:11:30.933Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-24557","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-24557","licence":"Public domain","modified":"2026-06-17T07:14:36.123Z"}],"updatedAt":"2026-11-25T22:58:36.499Z","epss":{"score":0.0026,"percentile":0.18976,"date":"2026-12-01T12:00:22.000Z"}}