Skip to main content

Docker Compose CVE-2025-62725

HIGH
Path Traversal (CWE-22)
2025-10-27 security-advisories@github.com
8.9
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Publish malicious OCI compose artifact
  2. Delivery
    Victim references and pulls artifact
  3. Exploit
    Path traversal via extends/envfile annotation
  4. Execution
    Write outside local cache directory
  5. Persist
    Overwrite arbitrary host file
  6. Impact
    Gain 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.

Act Now Prioritize within 24-48h. Why: HIGH severity + EPSS > 10%.
Patch available 13.7% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

go github.com/docker/compose no fix
go github.com/docker/compose/v2 fix: 2.40.2

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

Vendor (github) PRIMARY 8.9 HIGH
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
vuln.today AI 8.8 HIGH

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.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
13.7%
Top 4% exploitable
Prevalence
High
Docker Compose is widely deployed across developer, CI/CD, and container workflows
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 13.7%
Patch available Yes
Active threat No
Deciding rule
HIGH severity + EPSS > 10%
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: +14
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy