GBHackersDivya
Docker Compose Flaw Lets Attackers Overwrite Arbitrary Files
A path traversal vulnerability in Docker Compose, tracked as CVE-2025-62725, was discovered in early October 2025 and carries a high CVSS score of 8.9. According to GBHackers, the flaw affects Docker Compose prior to v2.40.2, enabling attackers to write arbitrary files to host systems through crafted OCI artifacts used by the new OCI-based Compose feature.
The vulnerability arises from unvalidated path annotations during processing of remote OCI layers, potentially allowing writes to sensitive locations such as SSH directories or configuration folders, without the user starting any containers. In the proof-of-concept, an attacker could inject an SSH public key into a victim’s authorized_keys file, granting remote access, as reported by Imperva.
Docker released a patch in Docker Compose v2.40.2 and later, which normalises and validates all annotation-derived paths before writing them to disk and rejects paths outside the cache directory. Organisations using Docker Compose should upgrade immediately to prevent exploitation, with the guidance published by GBHackers on 29 October 2025.