Skip to content

Support QPACK sensitivity detector for Never Indexed header fields (#17026) - #17038

Merged
normanmaurer merged 1 commit into
5.0from
qpack5
Jul 2, 2026
Merged

normanmaurer merged 1 commit into
5.0from
qpack5

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

QPACK (RFC 9204 4.5 / 7.1) defines an N ("Never Indexed") flag on
literal
field lines that tells intermediaries the field MUST NOT be inserted
into
their dynamic table. The current QpackEncoder hard-codes N = 0 for
every
literal and unconditionally lets the dynamic table absorb
every field. Users have no way to mark sensitive fields such as
Authorization, Cookie, Set-Cookie or Proxy-Authorization.

Modifications:

  • New QpackSensitivityDetector interface, mirroring HPACK's
    Http2HeadersEncoder.SensitivityDetector, with NEVER_SENSITIVE and
    ALWAYS_SENSITIVE constants. No built-in header list.
  • New QpackEncoder constructor accepting a detector; existing
    constructors
    delegate with NEVER_SENSITIVE — byte-for-byte backward-compatible.
  • New encodeSensitiveHeader path used when the detector returns
    true:
    exact static-table match indexed static; static name match literal
    with static-name-ref + N=1; otherwise pure literal + N=1. The field is
    never inserted into the dynamic table.

Result:

HTTP/3 services can mark sensitive headers as Never Indexed, matching
the
existing HPACK implementation. No behaviour change for users who do not
opt in.


Co-authored-by: Norman Maurer [email protected]

…17026)

Motivation:

QPACK (RFC 9204 4.5 / 7.1) defines an `N` ("Never Indexed") flag on
literal
field lines that tells intermediaries the field MUST NOT be inserted
into
their dynamic table. The current `QpackEncoder` hard-codes `N = 0` for
every
literal and unconditionally lets the dynamic table absorb
every field. Users have no way to mark sensitive fields such as
`Authorization`, `Cookie`, `Set-Cookie` or `Proxy-Authorization`.

Modifications:

- New `QpackSensitivityDetector` interface, mirroring HPACK's
  `Http2HeadersEncoder.SensitivityDetector`, with `NEVER_SENSITIVE` and
  `ALWAYS_SENSITIVE` constants. No built-in header list.
- New `QpackEncoder` constructor accepting a detector; existing
constructors
  delegate with `NEVER_SENSITIVE` — byte-for-byte backward-compatible.
- New `encodeSensitiveHeader` path used when the detector returns
`true`:
  exact static-table match indexed static; static name match literal
  with static-name-ref + N=1; otherwise pure literal + N=1. The field is
  never inserted into the dynamic table.

Result:

HTTP/3 services can mark sensitive headers as Never Indexed, matching
the
existing HPACK implementation. No behaviour change for users who do not
opt in.

---------

Co-authored-by: Norman Maurer <[email protected]>
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Jul 2, 2026
@normanmaurer
normanmaurer merged commit 7d21b69 into 5.0 Jul 2, 2026
13 checks passed
@normanmaurer
normanmaurer deleted the qpack5 branch July 2, 2026 09:14
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.

2 participants