Vulnerabilities in pkg:golang/github.com/compose-spec/compose-go/v2
PACKAGECVE-2024-10846 is a MODERATE (CVSS 5.9) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/compose spec/compose go/v2 libraries in the Go ecosystem. The issue involves excessive platform resource consumption within a loop when unmarshalling compose file having recursive loop. Remediation is available by upgrading affected packages to version 2.4.1.
pkg:golang/github.com/compose-spec/compose-go/v2
Vulnerability advisories affecting package pkg:golang/github.com/compose-spec/compose-go/v2. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-36gq-35j3-p9r9 | CVE-2024-10846 | MODERATE | Excessive Platform Resource Consumption within a Loop when unmarshalling Compose file having recursive loop |
CVE-2024-10846 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:H).
How to Fix CVE-2024-10846
To remediate this vulnerability, upgrade all affected Github.com/compose spec/compose go/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/compose-spec/compose-go/v2 to 2.4.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/compose-spec/compose-go/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-10846, inspect your project dependencies for Github.com/compose spec/compose go/v2:
inspect dependencies for github.com/compose-spec/compose-go/v2
Analyze the terminal output to locate any version of Github.com/compose spec/compose go/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.1), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Github.com/compose spec/compose go/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-2024-10846 Affected Github.com/compose spec/compose go/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/compose-spec/compose-go/v2
|
Go |
≥ 2.1.0
< 2.4.1
|
2.4.1
|
References
Frequently Asked Questions
What is CVE-2024-10846?
Which Github.com/compose spec/compose go/v2 versions are affected?
What version fixes CVE-2024-10846?
Is github.com/compose-spec/compose-go/v2 affected?
What is the CVSS score of CVE-2024-10846?
What CWE is associated with CVE-2024-10846?
How can I check Go dependencies for CVE-2024-10846?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-36gq-35j3-p9r9",
"modified" : "2025-04-28T14:09:27Z",
"published" : "2025-01-21T20:24:02Z",
"aliases" : [ "CVE-2024-10846" ],
"summary" : "Excessive Platform Resource Consumption within a Loop when unmarshalling Compose file having recursive loop",
"details" : "### Impact\nThe `compose-go` library component in versions `v2.10-v2.4.0` allows an authorized user who sends malicious YAML payloads to cause the `compose-go` to consume excessive amount of Memory and CPU cycles while parsing YAML, such as used by Docker Compose from versions ` v2.27.0` to `v2.29.7` included\n\n### Patches\ncompose-go `v2.24.1` fixed the issue\n\n### Workarounds\nThere isn't any known workaround.\n\n### References\n* https://github.com/docker/compose/issues/12235\n* https://github.com/compose-spec/compose-go/pull/703\n\n* https://github.com/compose-spec/compose-go/pull/618\n* https://github.com/docker/compose/commit/d239f0f3187a2ed5404c61f83bd5e995c81600ff#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R10",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/compose-spec/compose-go/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/compose-spec/compose-go/security/advisories/GHSA-36gq-35j3-p9r9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-10846"
}, {
"type" : "WEB",
"url" : "https://github.com/docker/compose/issues/12235"
}, {
"type" : "WEB",
"url" : "https://github.com/compose-spec/compose-go/pull/618"
}, {
"type" : "WEB",
"url" : "https://github.com/compose-spec/compose-go/pull/703"
}, {
"type" : "WEB",
"url" : "https://github.com/docker/compose/commit/d239f0f3187a2ed5404c61f83bd5e995c81600ff#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R10"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/compose-spec/compose-go"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20250425-0008"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-01-21T20:24:02Z",
"nvd_published_at" : "2025-01-23T16:15:33Z"
}
}