CVE-2025-62725 Docker Compose Vulnerable to Path Traversal via OCI Artifact Layer Annotations

High 8.9 Published Updated

Attackers can overwrite arbitrary files on the host by exploiting path traversal in Docker Compose's handling of remote OCI artifact annotations.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-62725?

CVE-2025-62725 is a high-severity path traversal vulnerability in docker compose, published on 27 Oct 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-22

Which versions are affected by CVE-2025-62725?

4 open source packages ship an affected version, including github.com/docker/compose/v2 and github.com/docker/compose.

PackageAffectedFixed in
github.com/docker/compose/v2 GoAll versions2.40.2
github.com/docker/compose/v2 GoFrom 2.34.02.40.2
github.com/docker/compose/v2 GoFrom 2.34.02.40.2
github.com/docker/compose GoAll versionsNone
Linux distribution packages (1)
docker-compose SUSE:Linux Micro 6.0All versions2.33.1-4.1

How do I fix CVE-2025-62725?

Upgrade github.com/docker/compose/v2 to 2.40.2 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-62725 being exploited?

There is no known exploitation of CVE-2025-62725 in the wild and no public exploit code.

Sources

Also known as GHSA-gv8h-7v7w-r22q, GO-2025-4077, SUSE-SU-2026:20871-1, UBUNTU-CVE-2025-62725.

Is CVE-2025-62725 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free