cve.bz

CVE-2025-62725 docker compose: Path traversal

8.9 highEPSS 17%Fix available

High (8.9) in docker compose. EPSS 17% estimated probability of exploitation activity in the next 30 days. Fixed in github.com/docker/compose/v2 2.40.2.

On this page
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.

Severity

CVSS 4.0

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
EPSS
17% (unchanged from 16% a week ago; 14% 30 days ago) estimated probability of exploitation activity in the next 30 days; 97th percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2025-10-28. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-62725 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-62725?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-62725?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-62725 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
docker compose< 2.40.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-gv8h-7v7w-r22qGogithub.com/docker/compose/v2>=2.34.0 <2.40.22.40.2
GO-2025-4077Gogithub.com/docker/composeall versionsno fix published
GO-2025-4077Gogithub.com/docker/compose/v2<2.40.22.40.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 2 moredocker-composeno fix listedUBUNTU-CVE-2025-62725
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0docker-compose2.33.1-160000.4.1SUSE-SU-2026:20976-1
SUSELinux Micro 6.0docker-compose2.33.1-4.1SUSE-SU-2026:20871-1
SUSELinux Micro 6.1docker-compose2.33.1-slfo.1.1_2.1SUSE-SU-2026:20656-1
SUSELinux Micro 6.2docker-compose2.33.1-160000.4.1SUSE-SU-2026:20949-1
openSUSELeap 16.0docker-compose2.33.1-160000.4.1openSUSE-SU-2026:20438-1
openSUSELeap 16.0govulncheck-vulndb0.0.20260723T184607-160000.1.1openSUSE-SU-2026:21483-1
openSUSETumbleweedgovulncheck-vulndb0.0.20251105T184115-1.1openSUSE-SU-2025:15710-1

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu · SUSE · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is considered Important rather than Moderate because it enables an attacker to perform arbitrary file overwrite on the host system through a simple path traversal attack vector, even when the user executes seemingly safe, read-only Docker Compose commands such as docker compose ps or docker compose config. The issue arises from improper validation of attacker-controlled OCI annotation values, allowing malicious paths to break out of the intended cache directory. While user interaction is required, the potential impact on system confidentiality, integrity, and availability is significant—modified configuration files, environment files, or scripts could lead to privilege escalation or further code execution.

Red Hat's mitigation

No mitigation is currently available that meets Red Hat Product Security’s standards for usability, deployment, applicability, or stability.

The risk can be reduced by avoiding the use of untrusted or third-party OCI compose artifacts and only sourcing artifacts from verified and trusted registries. Users should also restrict network access to prevent accidental retrieval of malicious remote artifacts and run Docker Compose commands only within controlled and isolated environments.

ProductPackageStateAdvisory
Red Hat Developer Hub 1rhdh/rhdh-hub-rhel9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-62725.

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON