Skip to content
OpenAdvisories
High · 8.9 CVE-2025-62725 EUVD-2025-36357GHSA-gv8h-7v7w-r22qGO-2025-4077

Docker Compose Vulnerable to Path Traversal via OCI Artifact Layer Annotations

Published Oct 27, 2025 · Updated Oct 28, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
docker compose < 2.40.2 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS docker-compose No fix yet —
Ubuntu 22.04 LTS docker-compose No fix yet —
Ubuntu 20.04 LTS docker-compose No fix yet —
Ubuntu 18.04 LTS docker-compose No fix yet —
Ubuntu 16.04 LTS docker-compose No fix yet —
ReleasePackageFixed inAdvisory
SLES for SAP 16.0 docker-compose 2.33.1-160000.4.1 SUSE-SU-2026:20976-1
SLES 16.0 docker-compose 2.33.1-160000.4.1 SUSE-SU-2026:20976-1
SLE Micro 6.2 docker-compose 2.33.1-160000.4.1 SUSE-SU-2026:20949-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.1 docker-compose 2.33.1-slfo.1.1_2.1 SUSE-SU-2026:20656-1
SLE Micro 6.0 docker-compose 2.33.1-4.1 SUSE-SU-2026:20871-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed govulncheck-vulndb 0.0.20251105T184115-1.1 openSUSE-SU-2025:15710-1
openSUSE Leap 16.0 docker-compose 2.33.1-160000.4.1 openSUSE-SU-2026:20438-1
openSUSE Leap 16.0 govulncheck-vulndb 0.0.20260723T184607-160000.1.1 openSUSE-SU-2026:21483-1

Affected packages

EcosystemPackageAffectedFixedRecord
Go github.com/docker/compose all versions — GO-2025-4077
Go github.com/docker/compose/v2 >= 2.34.0, < 2.40.2 2.40.2 GHSA-gv8h-7v7w-r22q
Go github.com/docker/compose/v2 < 2.40.2 2.40.2 GO-2025-4077

Advisories 7

References