ghsa-xg58-75qf-9r67
Vulnerability from github
6.9 (Medium) - 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
Impact
For users with the following configuration:
- An allow policy that selects a Layer 3 identity and a port range AND
- A Layer 7 allow policy 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.
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. This is a private mailing list for the Cilium security team, and your report will be treated as top priority.
{ "affected": [ { "package": { "ecosystem": "Go", "name": "github.com/cilium/cilium" }, "ranges": [ { "events": [ { "introduced": "1.16.0" }, { "fixed": "1.16.4" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2024-52529" ], "database_specific": { "cwe_ids": [ "CWE-755", "CWE-862" ], "github_reviewed": true, "github_reviewed_at": "2024-11-25T19:35:10Z", "nvd_published_at": "2024-11-25T19:15:11Z", "severity": "MODERATE" }, "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\u0027s 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\u0027s 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", "id": "GHSA-xg58-75qf-9r67", "modified": "2024-12-04T16:22:27Z", "published": "2024-11-25T19:35:10Z", "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" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N", "type": "CVSS_V3" }, { "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", "type": "CVSS_V4" } ], "summary": "Cilium\u0027s Layer 7 policy enforcement may not occur in policies with wildcarded port ranges" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.