Skip to content

[release/10.0] Fix: hardening http2 to refuse newline chars on trailers and dynamic HPACK table - #69248

Merged
SamMonoRT merged 2 commits into
release/10.0from
brecon/10valid
Sep 14, 2026
Merged

SamMonoRT merged 2 commits into
release/10.0from
brecon/10valid

Conversation

@BrennanConroy

Copy link
Copy Markdown
Member

Backport of #68743 to release/10.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?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Good test coverage, easy to reason about change

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

amf-fs and others added 2 commits September 11, 2026 11:22
…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
Copilot AI lite review requested due to automatic review settings September 11, 2026 18:23
@BrennanConroy BrennanConroy added Servicing-consider Shiproom approval is required for the issue feature-kestrel area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions labels Sep 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified, and regression coverage addresses the changed validation paths.

Review tier: Lite
Findings: None

What changed in this PR

Hardens Kestrel HTTP/2 and HTTP/3 processing by rejecting newline characters in trailers and dynamic HPACK values.

Changes:

  • Enables CR/LF validation for trailers and dynamic HPACK headers.
  • Adds HTTP/2 and HTTP/3 regression coverage for CR, LF, and CRLF values.
  • Expands invalid trailer test cases.
File Description
src/​Servers/​Kestrel/​test/​InMemory.FunctionalTests/​Http3/​Http3StreamTests.cs Tests HTTP/3 trailer newline rejection.
src/​Servers/​Kestrel/​test/​InMemory.FunctionalTests/​Http2/​Http2StreamTests.cs Tests dynamic HPACK newline rejection.
src/​Servers/​Kestrel/​test/​InMemory.FunctionalTests/​Http2/​Http2ConnectionTests.cs Adds invalid trailer cases.
src/​Servers/​Kestrel/​Core/​src/​Internal/​Http2/​Http2Connection.cs Validates dynamically indexed 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.

@BrennanConroy BrennanConroy added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 11, 2026
@dotnet-policy-service

Copy link
Copy Markdown
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
SamMonoRT self-requested a review September 14, 2026 17:59
@SamMonoRT
SamMonoRT merged commit 8a47b4b into release/10.0 Sep 14, 2026
32 checks passed
@SamMonoRT
SamMonoRT deleted the brecon/10valid branch September 14, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-kestrel Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants