Skip to content

Auto-port 4.1: Add opt-in validation of mandatory pseudo-header fields for HTTP/2#16964

Merged
chrisvest merged 1 commit into
4.1from
auto-port-pr-16932-to-4.1
Jun 16, 2026
Merged

Auto-port 4.1: Add opt-in validation of mandatory pseudo-header fields for HTTP/2#16964
chrisvest merged 1 commit into
4.1from
auto-port-pr-16932-to-4.1

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16932 to 4.1
Cherry-picked commit: 91ec8cd


Motivation:

RFC 9113 Section 8.3 requires HTTP/2 requests to include :method, :scheme and :path, and responses to include :status. Netty's message API (HttpConversionUtil) already rejects a missing :method, :path or :status, but the raw frame API
(Http2FrameCodec / Http2MultiplexHandler) does not validate this and accepts requests and responses with missing required pseudo-headers.

This is reported in #10633 and #13630.

Modification:

Add an optional validateRequiredPseudoHeaders setting (disabled by default) to DefaultHttp2ConnectionDecoder and the HTTP/2 builders. When enabled, initial request and response HEADERS that omit a required pseudo-header are rejected with
a PROTOCOL_ERROR stream error. CONNECT and extended CONNECT requests are handled according to RFC 9113 Section 8.5 and RFC 8441.

Result:

The raw frame API can now opt into RFC 9113 Section 8.3 required-pseudo-header
validation, while preserving existing behavior by default.

…16932)

Motivation:

RFC 9113 Section 8.3 requires HTTP/2 requests to include `:method`,
`:scheme` and `:path`, and responses to include `:status`. Netty's
message API (HttpConversionUtil) already rejects a missing :method,
:path or :status, but the raw frame API
(Http2FrameCodec / Http2MultiplexHandler) does not validate this and
accepts requests and responses with missing required pseudo-headers.

This is reported in #10633 and #13630.

Modification:

Add an optional `validateRequiredPseudoHeaders` setting (disabled by
default) to `DefaultHttp2ConnectionDecoder` and the HTTP/2 builders.
When enabled, initial request and response HEADERS that omit a required
pseudo-header are rejected with
a `PROTOCOL_ERROR` stream error. `CONNECT` and extended `CONNECT`
requests are handled according to RFC 9113 Section 8.5 and RFC 8441.

Result:

The raw frame API can now opt into RFC 9113 Section 8.3
required-pseudo-header
validation, while preserving existing behavior by default.

(cherry picked from commit 91ec8cd)
@chrisvest chrisvest added this to the 4.1.136.Final milestone Jun 16, 2026
@chrisvest chrisvest enabled auto-merge (squash) June 16, 2026 21:57
@chrisvest chrisvest merged commit a1e9aac into 4.1 Jun 16, 2026
18 checks passed
@chrisvest chrisvest deleted the auto-port-pr-16932-to-4.1 branch June 16, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants