Docker Compose
CVE-2025-62725
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious OCI compose artifact
-
DeliveryVictim references and pulls artifact
-
ExploitPath traversal via extends/envfile annotation
-
ExecutionWrite outside local cache directory
-
PersistOverwrite arbitrary host file
-
ImpactGain code execution on host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim's environment to resolve a remote OCI compose artifact controlled by the attacker, where a layer carries the com.docker.compose.extends or com.docker.compose.envfile annotation and the attacker sets a traversal path in com.docker.compose.file / com.docker.compose.envfile. The victim must invoke a docker compose operation against that artifact - but notably this includes read-only subcommands (docker compose config, docker compose ps), lowering the interaction bar. Affected are Docker Compose v2.34.0 through before v2.40.2 (Docker Desktop, standalone Linux binaries, CI/CD runners, cloud dev environments). Limiting factors: the attacker cannot act without inducing the victim to reference a hostile artifact (UI:A / AT:P), and non-affected/patched versions (>= 2.40.2) reject paths containing separators or escaping the cache directory. |
| Impact | This is a genuine priority, not a high-CVSS-but-low-risk issue, though it is not a mass-exploitable internet-facing flaw. The CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:A) indicates a network-reachable, low-complexity, unauthenticated bug, but two tempering metrics matter: AT:P (a specific attack requirement - the victim must resolve an attacker-controlled OCI artifact) and UI:A (active user interaction - someone must run a docker compose command against that artifact). EPSS is notably elevated at 13.70% (96th percentile), reflecting a clear, well-understood path-traversal primitive with a public fix commit, which often precedes exploit development. It is NOT in CISA KEV (no active exploitation confirmed) and no public exploit code was identified - only the vendor fix commit and a regression test, which are not weaponized exploits. The impact is severe (arbitrary file overwrite on the host, including via read-only subcommands), credibly enabling code execution or privilege escalation, which justifies the H ratings across confidentiality/integrity/availability. Net: a high-value target for supply-chain/CI-runner attacks where a malicious registry reference can be planted, but exploitation still depends on luring a victim into pulling a hostile artifact rather than unconditional remote compromise. |
| Exploit ScenarioDerived | An attacker publishes a malicious OCI compose artifact to a registry and tricks a developer or CI/CD pipeline into referencing it (e.g., a poisoned image/compose reference in a repo). When the victim runs docker compose - even a read-only command like docker compose config or docker compose ps - the attacker-controlled com.docker.compose.file/envfile annotation path traverses out of the cache directory and overwrites an arbitrary host file (e.g., a shell profile, cron, or binary), leading to code execution. No public exploit code exists, but the fix commit and its test cases clearly document the traversal technique. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
Path traversal in Docker Compose allows a malicious remote OCI compose artifact to write files outside Compose's local cache directory, giving an unauthenticated remote attacker arbitrary file overwrite on any host that resolves the artifact. Affected are Docker Compose v2.34.0 through versions before v2.40.2, covering Docker Desktop, standalone Compose binaries on Linux, CI/CD runners, and cloud dev environments; exploitation requires the victim to reference an attacker-controlled OCI artifact, but the trigger can be a read-only subcommand such as 'docker compose config' or 'docker compose ps', which lowers the interaction bar. No public exploit code has been identified at time of analysis and the flaw is not in CISA KEV, but the 13.70% EPSS score (96th percentile) signals meaningful real-world attention; the vendor-released patch is v2.40.2.
RemediationAI
Upgrade Docker Compose to v2.40.2 or later - the vendor-released patch (GHSA-gv8h-7v7w-r22q, fixing commit 69bcb962bfb2ea53b41aa925333d356b577d6176) enforces validatePathInBase, which rejects annotation values containing '/' or '\' and any path whose cleaned parent differs from the cache directory. On Docker Desktop, update to a release bundling Compose 2.40.2+; on Linux and CI/CD runners, replace standalone Compose binaries or the docker/compose image with the 2.40.2 tag, and note that the advisory lists no official workaround, so patching is the only complete fix. Where immediate upgrade is impossible, treat every remote OCI compose artifact as untrusted code: refuse to run 'docker compose -f oci://...' (and any config that auto-resolves such references) against artifacts you did not build, pin artifact digests rather than tags, and run Compose in an ephemeral, non-privileged container or sandbox user whose filesystem is disposable and whose writable paths are limited to the cache directory - the trade-off is increased operational friction and loss of convenience for third-party or upstream compose artifacts. Running Compose as a low-privilege user with no writable access to sensitive locations (SSH keys, shell profiles, system config, CI secrets mounted as files) reduces the blast radius but does not eliminate the traversal, since any file the Compose process can write remains reachable.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Docker Compose can pull compose files from remote OCI artifacts, and it treats layer annotations as trusted metadata. When a layer carries com.docker.compose.extends or com.docker.compose.envfile, the loader reads the attacker-supplied filename from com.docker.compose.file / com.docker.compose.envfile and passes it to filepath.Join with the local cache directory before calling os.Create, so a value such as '../../../etc/passwd' escapes the cache root. This is a classic CWE-22 path traversal rooted in unchecked '..' and path-separator sequences combined with directory-prefix path construction; the Go filepath.Join clean step does not constrain the result to the base directory. The upstream fix (commit 69bcb962bfb2ea53b41aa925333d356b577d6176) introduces validatePathInBase, which rejects any annotation value containing '\' or '/' regardless of OS and verifies that the cleaned directory of the joined target equals the cleaned cache base, returning 'invalid OCI artifact' otherwise; it also hardcodes the written compose filename to compose.yaml and applies the same validation to the env-file path. Note the CVSS 4.0 vector rates Privileges Required as None (PR:N) and UI as Active (UI:A), and the independent assessment concurs that exploitation depends on the victim resolving a hostile artifact rather than on any credential.
Know when Docker gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Remote malicious artifact with no auth (AV:N/PR:N) but victim must run compose against it (UI:R); arbitrary host file overwrite yields integrity loss and credible code execution, so C/I/A:H.
Primary rating from Vendor (github).
CVSS VectorVendor: github
DescriptionCVE.org
Docker Compose trusts the path information embedded in remote OCI compose artifacts. When a layer includes the annotations com.docker.compose.extends or com.docker.compose.envfile, Compose joins the attacker‑supplied value from com.docker.compose.file/com.docker.compose.envfile with its local cache directory and writes the file there. This affects any platform or workflow that resolves remote OCI compose artifacts, Docker Desktop, standalone Compose binaries on Linux, CI/CD runners, cloud dev environments is affected. An attacker can escape the cache directory and overwrite arbitrary files on the machine running docker compose, even if the user only runs read‑only commands such as docker compose config or docker compose ps. This issue is fixed in v2.40.2.
Executive ViewAI
Docker Compose - a tool embedded in Docker Desktop installations, standalone Linux build binaries, CI/CD runners, and cloud development environments - can be manipulated by a remote attacker to overwrite files on any host that resolves a hostile OCI compose artifact, including developer workstations and build agents that routinely hold deployment credentials. Because the trigger can be an ordinary read-only command, exposure extends well beyond teams that knowingly pull third-party artifacts. Leadership should care about the concentration of this risk in build infrastructure, where a single overwritten configuration file can translate into supply-chain compromise or sustained engineering downtime.
Apply vendor patch (v2.40.2 or later); until every instance is upgraded, block resolution of untrusted external OCI compose artifacts, restrict registry sources to an approved allowlist, and tighten write permissions on Compose cache directories.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system
Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
NVD
CVE.org
EPSS
GitHub
Exploit-DB