Full Report
A path traversal vulnerability discovered in Docker Compose allows attackers to write arbitrary files to host systems through specially crafted OCI artifacts. Tracked as CVE-2025-62725, the flaw was discovered in early October 2025 and carries a high severity rating of 8.9 CVSS. CVE ID CVE-2025-62725 Component Docker Compose OCI Artifacts Vulnerability Type Path Traversal / […] The post Docker Compose Flaw Lets Attackers Overwrite Arbitrary Files appeared first on GBHackers Security | #1 Globally Trusted Cyber Security News Platform.
Analysis Summary
# Vulnerability: Docker Compose Path Traversal Leading to Arbitrary File Write
## CVE Details
- CVE ID: CVE-2025-62725
- CVSS Score: 8.9 (High)
- CWE: Path Traversal (Implied)
## Affected Systems
- Products: Docker Compose
- Versions: Prior to v2.40.2
- Configurations: Systems utilizing the OCI-based Compose artifacts feature, where Docker Compose attempts to fetch and process remote artifacts.
## Vulnerability Description
A Path Traversal vulnerability exists in Docker Compose due to insufficient path validation when processing specially crafted OCI (Open Container Initiative) artifacts. Attackers can leverage malicious annotations within these OCI layers, which instruct the Compose tool where to write downloaded files. Because the vulnerable code trusts these annotations without normalizing or validating the paths, an attacker can use path traversal sequences (e.g., `../`) to write arbitrary files outside of the intended cache directory and into sensitive locations on the host system (e.g., SSH directories, configuration folders). This can occur during routine operations like `docker compose ps` or `docker compose config`, even without starting any containers.
## Exploitation
- Status: PoC available (Demonstrated path to injecting an SSH public key into `authorized_keys`).
- Complexity: Low (Requires tricking a victim into running a standard Compose command in a compromised directory context).
- Attack Vector: Network (via malicious remote OCI artifacts) / Local (by executing Compose command locally)
## Impact
- Confidentiality: High (If attacker can write files like SSH keys or configuration data).
- Integrity: High (Arbitrary file write allows for system configuration tampering or injection of code/keys).
- Availability: Medium to High (Depending on the system file overwritten).
## Remediation
### Patches
- Upgrade to Docker Compose version **v2.40.2 or later**. This version introduces proper path normalization and validation, rejecting paths that resolve outside the cache directory or contain absolute paths derived from annotations.
### Workarounds
- Avoid processing untrusted OCI-based Compose artifacts until patched.
- Ensure that any process executing Docker Compose commands only interacts with artifacts from trusted sources.
## Detection
- **Indicators of Compromise:** Unexpected files appearing in sensitive system directories (e.g., `.ssh/authorized_keys`, `/etc/`, application configuration directories).
- **Detection Methods and Tools:** Monitoring file system access logs for unexpected writes originating from the Docker Compose process, particularly during calls to `docker compose ps` or `docker compose config`.
## References
- Vendor Advisory: Docker/Relevant Security Bulletin (Not explicitly provided, referenced via Imperva report)
- Relevant Links: hxxps://www.imperva.com/blog/cve-2025-62725-from-docker-compose-ps-to-system-compromise/