-
Notifications
You must be signed in to change notification settings - Fork 540
Missing validation of value
field in HTTPHeader
#3669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, agreed, this is a bug, we should have validation to ensure that values match what's specified. However, the tricky part is that this is technically a breaking change, since we are tightening validation (by including some). Personally, I think this is okay in this instance because, as you say, there's no real way to use this for good - it's almost guaranteed to be broken. |
Thanks for catching this @kwaszczuk! I agree that we should fix this, but let's start with validation that's limited to experimental channel, and then bring it to standard channel in a follow up release as this is a breaking change like @youngnick said. |
+1 to experimental-first... |
/unassign |
I had some free time so i tried to approach this, but kept running into: |
Uh oh!
There was an error while loading. Please reload this page.
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: