Missing validation of value
field in HTTPHeader
#3669
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened:
Even though the
HTTPHeader
API reference explicitly states: "HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.", the Gateway API does not validateHTTPHeader.value
field at all. This allows header values to be defined with invalid characters according to RFC 7230, such as newlines (\n) and carriage returns (\r).This can have dramatic effects, breaking entire routing configurations in some implementations, e.g. Istio (see the example below), where including invalid header values causes the entire routing provisioning to fail.
What you expected to happen:
The Gateway API should validate
HTTPHeader.value
field according to RFC 7230 specification.How to reproduce it (as minimally and precisely as possible):
my-gateway
using Istio implementation:HTTPRoute
resource with aResponseHeaderModifier
with a header value containing newline or carriage return charactersAnything else we need to know?:
I believe this should be straightforward to address, so I am willing to contribute a fix.
The text was updated successfully, but these errors were encountered: