Repository navigation
Support QPACK sensitivity detector for Never Indexed header fields (#17026) - #17038
Merged
Merged
Conversation
…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]>
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.
Motivation:
QPACK (RFC 9204 4.5 / 7.1) defines an
N("Never Indexed") flag onliteral
field lines that tells intermediaries the field MUST NOT be inserted
into
their dynamic table. The current
QpackEncoderhard-codesN = 0forevery
literal and unconditionally lets the dynamic table absorb
every field. Users have no way to mark sensitive fields such as
Authorization,Cookie,Set-CookieorProxy-Authorization.Modifications:
QpackSensitivityDetectorinterface, mirroring HPACK'sHttp2HeadersEncoder.SensitivityDetector, withNEVER_SENSITIVEandALWAYS_SENSITIVEconstants. No built-in header list.QpackEncoderconstructor accepting a detector; existingconstructors
delegate with
NEVER_SENSITIVE— byte-for-byte backward-compatible.encodeSensitiveHeaderpath used when the detector returnstrue: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]