Vulnerabilities in pkg:golang/github.com/docker/compose/v2
PACKAGECVE-2025-62725 is a HIGH path traversal vulnerability (CWE-20: Improper Input Validation) affecting Github.com/docker/compose/v2 libraries in the Go ecosystem. The issue involves docker compose vulnerable to path traversal via oci artifact layer annotations. Remediation is available by upgrading affected packages to version 2.40.2.
pkg:golang/github.com/docker/compose/v2
Vulnerability advisories affecting package pkg:golang/github.com/docker/compose/v2. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-gv8h-7v7w-r22q | CVE-2025-62725 | HIGH | Docker Compose Vulnerable to Path Traversal via OCI Artifact Layer Annotations |
CVE-2025-62725 at a Glance
How to Fix CVE-2025-62725
To remediate this vulnerability, upgrade all affected Github.com/docker/compose/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/docker/compose/v2 to 2.40.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/docker/compose/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-62725, inspect your project dependencies for Github.com/docker/compose/v2:
inspect dependencies for github.com/docker/compose/v2
Analyze the terminal output to locate any version of Github.com/docker/compose/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.40.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/docker/compose/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-62725 Affected Github.com/docker/compose/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/docker/compose/v2
|
Go |
≥ 2.34.0
< 2.40.2
|
2.40.2
|
References
Frequently Asked Questions
What is CVE-2025-62725?
Which Github.com/docker/compose/v2 versions are affected?
What version fixes CVE-2025-62725?
Is github.com/docker/compose/v2 affected?
What CWE is associated with CVE-2025-62725?
How can I check Go dependencies for CVE-2025-62725?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gv8h-7v7w-r22q",
"modified" : "2025-11-27T08:53:10Z",
"published" : "2025-10-27T20:19:34Z",
"aliases" : [ "CVE-2025-62725" ],
"summary" : "Docker Compose Vulnerable to Path Traversal via OCI Artifact Layer Annotations",
"details" : "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. \n\n### Impact\nThis 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.\nAn 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.\n\n### Patches\nv2.40.2\n\n### Workarounds\nNA",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/docker/compose/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.34.0"
}, {
"fixed" : "2.40.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/docker/compose/security/advisories/GHSA-gv8h-7v7w-r22q"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-62725"
}, {
"type" : "WEB",
"url" : "https://github.com/docker/compose/commit/69bcb962bfb2ea53b41aa925333d356b577d6176"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/docker/compose"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-27T20:19:34Z",
"nvd_published_at" : "2025-10-27T21:15:38Z"
}
}