CVE-2025-62725Docker Compose Vulnerable to Path Traversal via OCI Artifact Layer Annotations
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.
What to do
Fixed builds are available from Go: see the table below for the fixed version per release.
Go, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | docker-compose | Under investigation | UBUNTU-CVE-2025-62725 | |
| Ubuntu 22.04 | docker-compose | Under investigation | UBUNTU-CVE-2025-62725 | |
| Ubuntu 20.04 | docker-compose | Fix pending | UBUNTU-CVE-2025-62725 | |
| Ubuntu 18.04 | docker-compose | Fix pending | UBUNTU-CVE-2025-62725 | |
| Ubuntu 16.04 | docker-compose | Fix pending | UBUNTU-CVE-2025-62725 | |
| Go library | github.com/docker/compose | Fix pending | GO-2025-4077 | |
| Go library | github.com/docker/compose/v2 | Fixed | 2.40.2 | GHSA-gv8h-7v7w-r22q |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- docker compose: affected: < 2.40.2
References
- https://github.com/docker/compose/security/advisories/GHSA-gv8h-7v7w-r22q
- https://github.com/docker/compose/commit/69bcb962bfb2ea53b41aa925333d356b577d6176
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.