Repository navigation
[release/11.0] Fix: hardening http2 to refuse newline chars on trailers and dynamic HPACK table - #69247
Merged
Conversation
…HPACK table (#68743) * Hardening trailers to refuse new line chars * Hardening HPACK dynamic header to refuse new line chars * Http3 request trailers with newline chars test * Added test to exercise newline chars on indexed headers
Co-authored-by: Copilot App <[email protected]>
BrennanConroy
temporarily deployed
to
copilot-pat-pool
September 11, 2026 18:21 — with
GitHub Actions
Inactive
BrennanConroy
temporarily deployed
to
copilot-pat-pool
September 11, 2026 18:22 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Update the HTTP/3 trailer test to use _noopApplication so malformed trailers do not produce unrelated application errors.
Review tier: Lite
Findings: None
What changed in this PR
This backport hardens Kestrel HTTP/2 and HTTP/3 handling by rejecting CR/LF characters in request trailers and dynamic HPACK values.
Changes:
- Enables newline validation for trailers and dynamic HPACK headers.
- Adds HTTP/2 and HTTP/3 regression coverage for malformed values.
- Refactors HTTP/2 trailer test data setup.
| File | Summary |
|---|---|
src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs |
Tests HTTP/3 trailer newline rejection; should use _noopApplication to avoid unrelated application errors. |
src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs |
Tests dynamic HPACK newline rejection. |
src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs |
Adds malformed HTTP/2 trailer cases. |
src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs |
Validates dynamic HPACK header values. |
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs |
Validates request trailer values. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Hi @BrennanConroy. 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. |
SamMonoRT
approved these changes
Sep 14, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #68743 to release/11.0
Fix: hardening http2 to refuse newline chars on trailers and dynamic HPACK table
Description
Kestrel previously skipped validation for CR/LF in two places: request trailers and HPACK dynamic table retrieval. Based on RFC 7540 section 10.3, these values must be treated as malformed. The validation for newline characters has now been enabled along with tests to ensure compliance.
Customer Impact
Invalid headers could show up in logs or application logic processing.
Regression?
Risk
Good test coverage, easy to reason about change
Verification
Packaging changes reviewed?