8.9high
Docker Compose Vulnerable to Path Traversal via OCI Artifact Layer Annotations
- Severity
- 8.9high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 16.5% (higher than 97% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-gv8h-7v7w-r22qGO-2025-4077
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| docker compose | < 2.40.2 | CVE List |
| github.com/docker/compose/v2 (Go) | from 2.34.0 before 2.40.2, before 2.40.2 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/docker/compose (Go) | all versions | Go Vulnerability Database |
All scores
| GitHub_M | 8.9high CVSS:4.0 | 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 |
| GitHub | high CVSS:4.0 | 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 |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
Impact
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.
Patches
v2.40.2
Workarounds
NA
Go Vulnerability Database
Docker Compose Vulnerable to Path Traversal via OCI Artifact Layer Annotations in github.com/docker/compose
NVD (es)
Docker Compose confía en la información de ruta incrustada en artefactos de composición OCI remotos. Cuando una capa incluye las anotaciones com.docker.compose.extends o com.docker.compose.envfile, Compose une el valor proporcionado por el atacante de com.docker.compose.file/com.docker.compose.envfile con su directorio de caché local y escribe el archivo allí. Esto afecta a cualquier plataforma o flujo de trabajo que resuelva artefactos de composición OCI remotos, como Docker Desktop, los binarios de Compose autónomos en Linux, los ejecutores de CI/CD y los entornos de desarrollo en la nube. Un atacante puede escapar del directorio de caché y sobrescribir archivos arbitrarios en la máquina que ejecuta docker compose, incluso si el usuario solo ejecuta comandos de solo lectura como docker compose config o docker compose ps. Este problema está solucionado en la v2.40.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-62725 changed 2025-10-28 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-gv8h-7v7w-r22q changed 2025-11-27 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2025-4077 changed 2026-03-03 | CC-BY-4.0 |
| NVD | CVE-2025-62725 changed 2026-10-08 | Public domain |