CVE-2024-10846: Github.com/compose spec/compose go/v2 Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-36gq-35j3-p9r9
CVSS 5.9
CWE-400 CWE-20
Published
Advisory Summary

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

CVE-2024-10846 at a Glance

CVE Identifier CVE-2024-10846
GHSA Identifier GHSA-36gq-35j3-p9r9
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Github.com/compose spec/compose go/v2
Package Ecosystem Go
Published Date
Last Updated

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

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (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.

github.com/compose-spec/compose-go/v2 fixed: 2.4.1
Upgrade github.com/compose-spec/compose-go/v2 to 2.4.1
Verify Direct and Transitive Dependencies

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

### Impact The `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 ### Patches compose-go `v2.24.1` fixed the issue ### Workarounds There isn't any known workaround. ### References * https://github.com/docker/compose/issues/12235 * https://github.com/compose-spec/compose-go/pull/703 * https://github.com/compose-spec/compose-go/pull/618 * https://github.com/docker/compose/commit/d239f0f3187a2ed5404c61f83bd5e995c81600ff#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R10

CVE-2024-10846 Affected Github.com/compose spec/compose go/v2 Versions

1 component(s)
Fixed Versions:
2.4.1
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?
CVE-2024-10846 is a security vulnerability in Github.com/compose spec/compose go/v2 involving Excessive Platform Resource Consumption within a Loop when unmarshalling Compose file having recursive loop under CWE-400: Uncontrolled Resource Consumption.
Which Github.com/compose spec/compose go/v2 versions are affected?
Affected versions include releases prior to 2.4.1 across affected packages: github.com/compose-spec/compose-go/v2.
What version fixes CVE-2024-10846?
Upgrading to 2.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/compose-spec/compose-go/v2 affected?
Yes, github.com/compose-spec/compose-go/v2 is affected in releases prior to 2.4.1. Upgrade your dependency to 2.4.1 or later.
What is the CVSS score of CVE-2024-10846?
CVE-2024-10846 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:H.
What CWE is associated with CVE-2024-10846?
CVE-2024-10846 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2024-10846?
Run the dependency tree command: 'inspect dependencies for github.com/compose-spec/compose-go/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}