Skip to content

GHSA-qcm3-7879-xcww BIT-cilium-2024-42487 BIT-cilium-operator-2024-42487 BIT-hubble-relay-2024-42487 CVE-2024-42487 GO-2024-3071

Gateway API route matching order contradicts specification

Medium Go
Severity
4.0 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.53%
Chance of exploitation in the next 30 days. Higher than 45.18% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-113 Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')
CWE-436 Interpretation Conflict
Fix
1.16.1
Upgrade github.com/cilium/cilium to this version or later

Description

Impact

Gateway API HTTPRoutes and GRPCRoutes do not follow the match precedence specified in the Gateway API specification. In particular, request headers are matched before request methods, when the specification describes that the request methods must be respected before headers are matched (HTTPRouteRule, GRPCRouteRule).

If users create Gateway API resources that use both request headers and request methods in order to route to different destinations, then traffic may be delivered to the incorrect backend. If the backend does not have Network Policy restricting acceptable traffic to receive, then requests may access information that you did not intend for them to access.

Patches

This issue was fixed in https://github.com/cilium/cilium/pull/34109.

This issue affects:

  • Cilium v1.15 between v1.15.0 and v1.15.7 inclusive
  • Cilium v1.16.0

This issue is fixed in:

  • Cilium v1.15.8
  • Cilium v1.16.1

Workarounds

There is no workaround for this issue.

Acknowledgements

The Cilium community has worked together with members of Cure53 and Isovalent to prepare these mitigations. Special thanks to @sayboras for remediating this issue.

Further 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 versions

Go

PackageVulnerableFixed in
github.com/cilium/cilium
>= 1.16.0, < 1.16.1
1.16.1
github.com/cilium/cilium
>= 1.15.0, < 1.15.8
1.15.8
github.com/cilium/cilium
>= 1.15.0, < 1.15.8
>= 1.16.0, < 1.16.1
1.15.8
1.16.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

github.com/cilium/cilium Go → 1.16.1

go
go get github.com/cilium/cilium@v1.16.1 && go mod tidy

Severity breakdown

CVSS 3.1 4.0

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

Weakness

CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')

The product receives data from an HTTP agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.

How to prevent it
  • Implementation: Construct HTTP headers very carefully, avoiding the use of non-validated input data.
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. If an input does not strictly conform to specifications, reject it or transform it into something that conforms. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • Implementation: Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
  • Implementation: Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

CWE-436: Interpretation Conflict

Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-fm8w-2m5w-9j7r
Cilium may unexpectedly allow ingress traffic from the local namespace when a Kubernetes NetworkPolicy is configured with an ipBlock match
Medium Also affects github.com/cilium/cilium
GHSA-w7c2-w76w-5hmj
Cilium: Namespaced HTTPRoutes can redirect traffic to other namespaces
High Also affects github.com/cilium/cilium
GHSA-q6h5-q3q6-f87x
CiliumLocalRedirectPolicy addressMatcher allows cross-namespace service traffic hijacking and can break service translation
Medium Also affects github.com/cilium/cilium
GHSA-3fcv-jvfp-m4q9
Cilium vulnerable to sensitive information disclosure and cluster disruption via local Envoy admin socket access
High Also affects github.com/cilium/cilium
GHSA-gj49-89wh-h4gj
Cillium exposes sensitive information included in the cilium-bugtool debug archive
Medium Also affects github.com/cilium/cilium
GHSA-hxv8-4j4r-cqgv
Cilium L7 proxy may bypass Kubernetes NetworkPolicy for same-node traffic
Medium Also affects github.com/cilium/cilium
GHSA-5r23-prx4-mqg3
Cilium may not enforce host firewall policies when Native Routing, WireGuard and Node Encryption are enabled
Medium Also affects github.com/cilium/cilium
GHSA-38pp-6gcp-rqvm
Cilium with misconfigured toGroups in policies can lead to unrestricted egress traffic
Medium Also affects github.com/cilium/cilium
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor