Bug 2262352 (CVE-2024-24557)

Summary: CVE-2024-24557 moby: classic builder cache poisoning
Product: [Other] Security Response Reporter: Patrick Del Bello <pdelbell>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: amctagga, aoconnor, bniver, dfreiber, drow, flucifre, gmeno, jburrell, jwendell, mbenjamin, mhackett, rcernich, sostapov, twalsh, vereddy, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: moby 25.0.2, moby 24.0.9 Doc Type: ---
Doc Text:
A vulnerability was found in github.com/moby/moby. The classic builder cache system in moby is vulnerable to cache poisoning if the image is built using a 'FROM scratch' in Dockerfile. This flaw allows an attacker who has knowledge of the Dockerfile to create a malicious cache that would be pulled and considered a valid cache candidate for some build steps. This only affects one if using DOCKER_BUILDKIT=0 or using the /build API endpoint.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2262353, 2262354    
Bug Blocks: 2262351    

Description Patrick Del Bello 2024-02-02 01:00:26 UTC
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.

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

Comment 5 errata-xmlrpc 2025-06-23 02:17:57 UTC
This issue has been addressed in the following products:

  Red Hat Ceph Storage 7.1

Via RHSA-2025:9340 https://access.redhat.com/errata/RHSA-2025:9340

Comment 6 errata-xmlrpc 2025-07-24 15:20:42 UTC
This issue has been addressed in the following products:

  Red Hat Ceph Storage 8.1

Via RHSA-2025:11749 https://access.redhat.com/errata/RHSA-2025:11749