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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| 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.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| 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
- openSUSE-SU-2026:21483-1 Security update for govulncheck-vulndb SUSE / openSUSE Security Updates · Jul 31, 2026
- SUSE-SU-2026:20976-1 Security update for docker-compose SUSE / openSUSE Security Updates · Apr 10, 2026
- openSUSE-SU-2026:20438-1 Security update for docker-compose SUSE / openSUSE Security Updates · Apr 3, 2026
- SUSE-SU-2026:20949-1 Security update for docker-compose SUSE / openSUSE Security Updates · Apr 2, 2026
- SUSE-SU-2026:20871-1 Security update for docker-compose SUSE / openSUSE Security Updates · Mar 28, 2026
- openSUSE-SU-2025:15710-1 govulncheck-vulndb-0.0.20251105T184115-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20656-1 Security update for docker-compose SUSE / openSUSE Security Updates · Mar 23, 2026