CVE-2024-52529: Github.com/cilium/cilium Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-xg58-75qf-9r67
CVSS 5.8
CWE-755 CWE-862
Published
Advisory Summary

CVE-2024-52529 is a MODERATE (CVSS 5.8) remote code execution vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting Github.com/cilium/cilium libraries in the Go ecosystem. The issue involves cilium's layer 7 policy enforcement may not occur in policies with wildcarded port ranges. Remediation is available by upgrading affected packages to version 1.16.4.

CVE-2024-52529 at a Glance

CVE Identifier CVE-2024-52529
GHSA Identifier GHSA-xg58-75qf-9r67
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product Github.com/cilium/cilium
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-52529

To remediate this vulnerability, upgrade all affected Github.com/cilium/cilium 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/cilium/cilium fixed: 1.16.4
Upgrade github.com/cilium/cilium to 1.16.4
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/cilium/cilium

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-52529, inspect your project dependencies for Github.com/cilium/cilium:

inspect dependencies for github.com/cilium/cilium

Analyze the terminal output to locate any version of Github.com/cilium/cilium in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16.4), 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-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In Github.com/cilium/cilium, 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 For users with the following configuration: * An allow policy that selects a [Layer 3 identity](https://docs.cilium.io/en/v1.14/security/policy/language/#layer-3-examples) and a [port range](https://docs.cilium.io/en/stable/security/policy/language/#example-port-ranges) **AND** * A [Layer 7 allow policy](https://docs.cilium.io/en/latest/security/policy/language/#layer-7-examples) that selects a specific port within the first policy's range then Layer 7 enforcement would not occur for the traffic selected by the Layer 7 policy. This issue only affects users who use Cilium's port range functionality, which was introduced in Cilium v1.16. For reference, an example of a pair of policies that would trigger this issue is: ``` apiVersion: "cilium.io/v2" kind: CiliumNetworkPolicy metadata: name: "layer-3-and-4" spec: endpointSelector: matchLabels: app: service ingress: - fromCIDR: - 192.168.60.0/24 toPorts: - ports: - port: "80" endPort: 444 protocol: TCP ``` and ``` apiVersion: "cilium.io/v2" kind: CiliumNetworkPolicy metadata: name: "layer-4-and-7" spec: endpointSelector: matchLabels: app: service ingress: toPorts: - ports: - port: "80" protocol: TCP rules: http: - method: "GET" path: "/public" ``` In the above example, requests would be permitted to all HTTP paths on matching endpoints, rather than just `GET` requests to the `/public` path as intended by the `layer-4-and-7` policy. In patched versions of Cilium, the `layer-4-and-7` rule would take precedence over the `layer-3-and-4` rule. ### Patches This issue is patched in https://github.com/cilium/cilium/pull/35150. This issue affects Cilium v1.16 between v1.16.0 and v1.16.3 inclusive. This issue is patched in Cilium v1.16.4. ### Workarounds Users with network policies that match the pattern described above can work around the issue by rewriting any policies that use port ranges to individually specify the ports permitted for traffic. ### Acknowledgements The Cilium community has worked together with members of Isovalent to prepare these mitigations. Special thanks to @jrajahalme for resolving this issue. ### For more information If you have any questions or comments about this advisory, please reach out on [Slack](https://docs.cilium.io/en/latest/community/community/#slack). If you think you have found a vulnerability affecting Cilium, we strongly encourage you to report it to our security mailing list at [security@cilium.io](mailto:security@cilium.io). This is a private mailing list for the Cilium security team, and your report will be treated as top priority.

CVE-2024-52529 Affected Github.com/cilium/cilium Versions

1 component(s)
Fixed Versions:
1.16.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cilium/cilium
Go
≥ 1.16.0
< 1.16.4
1.16.4

References

Frequently Asked Questions

What is CVE-2024-52529?
CVE-2024-52529 is a security vulnerability in Github.com/cilium/cilium involving Cilium's Layer 7 policy enforcement may not occur in policies with wildcarded port ranges under CWE-755: Improper Handling of Exceptional Conditions.
Which Github.com/cilium/cilium versions are affected?
Affected versions include releases prior to 1.16.4 across affected packages: github.com/cilium/cilium.
What version fixes CVE-2024-52529?
Upgrading to 1.16.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cilium/cilium affected?
Yes, github.com/cilium/cilium is affected in releases prior to 1.16.4. Upgrade your dependency to 1.16.4 or later.
What is the CVSS score of CVE-2024-52529?
CVE-2024-52529 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2024-52529?
CVE-2024-52529 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check Go dependencies for CVE-2024-52529?
Run the dependency tree command: 'inspect dependencies for github.com/cilium/cilium'. 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-xg58-75qf-9r67",
  "modified" : "2024-12-04T16:22:27Z",
  "published" : "2024-11-25T19:35:10Z",
  "aliases" : [ "CVE-2024-52529" ],
  "summary" : "Cilium's Layer 7 policy enforcement may not occur in policies with wildcarded port ranges",
  "details" : "### Impact\n\nFor users with the following configuration:\n\n* An allow policy that selects a [Layer 3 identity](https://docs.cilium.io/en/v1.14/security/policy/language/#layer-3-examples) and a [port range](https://docs.cilium.io/en/stable/security/policy/language/#example-port-ranges) **AND**\n* A [Layer 7 allow policy](https://docs.cilium.io/en/latest/security/policy/language/#layer-7-examples) that selects a specific port within the first policy's range \n\nthen Layer 7 enforcement would not occur for the traffic selected by the Layer 7 policy.\n\nThis issue only affects users who use Cilium's port range functionality, which was introduced in Cilium v1.16.\n\nFor reference, an example of a pair of policies that would trigger this issue is:\n\n```\napiVersion: \"cilium.io/v2\"\nkind: CiliumNetworkPolicy\nmetadata:\n  name: \"layer-3-and-4\"\nspec:\n  endpointSelector:\n    matchLabels:\n      app: service\n  ingress:\n    - fromCIDR:\n      - 192.168.60.0/24\n      toPorts:\n      - ports:\n        - port: \"80\"\n          endPort: 444\n          protocol: TCP\n```\nand\n```\napiVersion: \"cilium.io/v2\"\nkind: CiliumNetworkPolicy\nmetadata:\n  name: \"layer-4-and-7\"\nspec:\n  endpointSelector:\n    matchLabels:\n      app: service\n  ingress:\n    toPorts:\n    - ports:\n      - port: \"80\"\n        protocol: TCP\n      rules:\n        http:\n        - method: \"GET\"\n          path: \"/public\"\n```\n\nIn the above example, requests would be permitted to all HTTP paths on matching endpoints, rather than just `GET` requests to the `/public` path as intended by the `layer-4-and-7` policy. In patched versions of Cilium, the `layer-4-and-7` rule would take precedence over the `layer-3-and-4` rule.\n\n### Patches\n\nThis issue is patched in https://github.com/cilium/cilium/pull/35150.\n\nThis issue affects Cilium v1.16 between v1.16.0 and v1.16.3 inclusive.\n\nThis issue is patched in Cilium v1.16.4.\n\n### Workarounds\n\nUsers with network policies that match the pattern described above can work around the issue by rewriting any policies that use port ranges to individually specify the ports permitted for traffic.\n\n### Acknowledgements\nThe Cilium community has worked together with members of Isovalent to prepare these mitigations. Special thanks to @jrajahalme for resolving this issue.\n\n### For more information\nIf you have any questions or comments about this advisory, please reach out on [Slack](https://docs.cilium.io/en/latest/community/community/#slack).\n\nIf you think you have found a vulnerability affecting Cilium, we strongly encourage you to report it to our security mailing list at [security@cilium.io](mailto:security@cilium.io). This is a private mailing list for the Cilium security team, and your report will be treated as top priority.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cilium/cilium"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.16.0"
      }, {
        "fixed" : "1.16.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cilium/cilium/security/advisories/GHSA-xg58-75qf-9r67"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52529"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cilium/cilium/pull/35150"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cilium/cilium"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-755", "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-25T19:35:10Z",
    "nvd_published_at" : "2024-11-25T19:15:11Z"
  }
}