CVE-2025-62725: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in docker compose
CVE-2025-62725 is a path traversal vulnerability in Docker Compose that allows an attacker to escape the local cache directory and overwrite arbitrary files on the host machine. This occurs because Docker Compose trusts path information embedded in remote OCI compose artifacts and improperly joins attacker-supplied values with local paths. The vulnerability affects multiple platforms and workflows that resolve remote OCI compose artifacts, including Docker Desktop, standalone Compose binaries on Linux, CI/CD runners, and cloud development environments. The issue is fixed in Docker Compose version 2.40.2.
AI Analysis
Technical Summary
Docker Compose improperly limits pathname resolution when handling remote OCI compose artifacts containing the annotations com.docker.compose.extends or com.docker.compose.envfile. It joins attacker-controlled values from com.docker.compose.file or com.docker.compose.envfile with its local cache directory path and writes files there without sufficient validation. This allows an attacker to perform path traversal and overwrite arbitrary files on the host machine, even when running read-only commands such as 'docker compose config' or 'docker compose ps'. The vulnerability affects all Docker Compose versions prior to 2.40.2 and impacts any platform or workflow that resolves remote OCI compose artifacts.
Potential Impact
An attacker can escape the intended cache directory and overwrite arbitrary files on the machine running Docker Compose. This can lead to unauthorized file modification or code execution depending on the files overwritten. The vulnerability can be exploited even when users run read-only Docker Compose commands, increasing the attack surface. The CVSS 4.0 base score is 8.9 (high severity), reflecting network attack vector, low attack complexity, partial attack traceability, no privileges required, and high impact on confidentiality, integrity, availability, and security requirements.
Mitigation Recommendations
A fix is available in Docker Compose version 2.40.2. Users and administrators should upgrade to version 2.40.2 or later to remediate this vulnerability. There is no indication that any temporary workaround or mitigation is effective or recommended. Applying the official fix is the advised course of action.
CVE-2025-62725: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in docker compose
Description
CVE-2025-62725 is a path traversal vulnerability in Docker Compose that allows an attacker to escape the local cache directory and overwrite arbitrary files on the host machine. This occurs because Docker Compose trusts path information embedded in remote OCI compose artifacts and improperly joins attacker-supplied values with local paths. The vulnerability affects multiple platforms and workflows that resolve remote OCI compose artifacts, including Docker Desktop, standalone Compose binaries on Linux, CI/CD runners, and cloud development environments. The issue is fixed in Docker Compose version 2.40.2.
CVSS v4.0
Score 8.9high
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Docker Compose improperly limits pathname resolution when handling remote OCI compose artifacts containing the annotations com.docker.compose.extends or com.docker.compose.envfile. It joins attacker-controlled values from com.docker.compose.file or com.docker.compose.envfile with its local cache directory path and writes files there without sufficient validation. This allows an attacker to perform path traversal and overwrite arbitrary files on the host machine, even when running read-only commands such as 'docker compose config' or 'docker compose ps'. The vulnerability affects all Docker Compose versions prior to 2.40.2 and impacts any platform or workflow that resolves remote OCI compose artifacts.
Potential Impact
An attacker can escape the intended cache directory and overwrite arbitrary files on the machine running Docker Compose. This can lead to unauthorized file modification or code execution depending on the files overwritten. The vulnerability can be exploited even when users run read-only Docker Compose commands, increasing the attack surface. The CVSS 4.0 base score is 8.9 (high severity), reflecting network attack vector, low attack complexity, partial attack traceability, no privileges required, and high impact on confidentiality, integrity, availability, and security requirements.
Mitigation Recommendations
A fix is available in Docker Compose version 2.40.2. Users and administrators should upgrade to version 2.40.2 or later to remediate this vulnerability. There is no indication that any temporary workaround or mitigation is effective or recommended. Applying the official fix is the advised course of action.
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-10-20T19:41:22.742Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 68ffdbe2ba6dffc5e20d7f34
Added to database: 10/27/2025, 20:53:54 UTC
Last enriched: 08/08/2026, 14:59:19 UTC
Last updated: 08/09/2026, 00:41:10 UTC
Views: 1120
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.