-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[release/7.0] Send 431 when HTTP/2&3 headers are too large or many #44767
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
Conversation
|
/backport to release/6.0 |
|
Started backporting to release/6.0: https://github.com/dotnet/aspnetcore/actions/runs/3339575274 |
|
@Tratcher backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Send 431 when HTTP/2 headers are too large or many #17861
Using index info to reconstruct a base tree...
M src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs
M src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
M src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs
M src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
M src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs
M src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs
CONFLICT (content): Merge conflict in src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs
Auto-merging src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs
CONFLICT (content): Merge conflict in src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs
Auto-merging src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
CONFLICT (content): Merge conflict in src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
Auto-merging src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs
CONFLICT (content): Merge conflict in src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs
Auto-merging src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
CONFLICT (content): Merge conflict in src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
Auto-merging src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs
CONFLICT (content): Merge conflict in src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Send 431 when HTTP/2 headers are too large or many #17861
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
|
Hi @github-actions[bot]. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
|
Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed. |
Backport of #44668 to release/7.0
Send 431 when HTTP/2&3 headers are too large or many
Harden HTTP/2 & 3 to send back 431 errors rather than aborting the connection.
Description
When HTTP/2 hits a header related limit (total size or count) it aborts the connection because HPACK is stateful and failing to process the rest of the headers in a request could corrupt the connection HPACK state. HTTP/3 copied this model. This causes performance and debuggability issues for applications.
To avoid this we'll allow up to 2x of the limits while processing the headers, but then enforce the hard limits later when we can send a 431.
Contributes to #17861 #33622
Customer Impact
Customers have a hard time debugging an application when it kills the connection without reporting an error to the client. It also affects other parallel requests on the same connection.
Regression?
Risk
Small modification to existing behavior.
Verification
Packaging changes reviewed?