http2: support adding never-index header fields #34091
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.http2Issues and PRs related to the http2 subsystem.Issues and PRs related to the http2 subsystem.
Description
As part of the HTTP2 (and HTTP3) spec, some headers can be sent as Literal Header Field Never Indexed
https://www.rfc-editor.org/rfc/rfc7541.html#section-6.2.3
This can be used for security reasons to avoid CRIME (Compression Ratio Info-leak Made Easy) attacks to expose sensitive information.
Points of interest are:
It'll help diagnose #28632
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.http2Issues and PRs related to the http2 subsystem.Issues and PRs related to the http2 subsystem.
Activity
jasnell commentedon Jun 30, 2020
This is definitely something that was considered early on when I did the initial implementation. It is hampered by the fact that we tried to keep the API for headers in http/2 as close as possible to that of http/1, which uses a simple object to express headers... e.g.
The difficulty here becomes: how do we indicate which headers should not be indexed? Should it be specified per-request? Should it be specified separately from the actual header pairs?
One way we could do this could be to allow a list of never-index header names as options whenever headers are specified... e.g.
Each method that accepts headers would need to be updated to accept an options object. This seems like the most ergonomic way to go.
addaleax commentedon Jun 30, 2020
@jasnell Just for context, I am already working on this :)
clshortfuse commentedon Jun 30, 2020
@jasnell
Personally, I prefer option #2.Whoops! Realized there's only one option. 😄 It's similar to HTTP1 and makesnever-indexan "upgraded" option.But, I think there's a theoretical possibility that needs to be explored. What if you want some headers to be indexed, and some not that are of the same header-field name? You might want to do:
PS: I use the term "sensitive" because one of the names the spec refers to them by:
jasnell commentedon Jun 30, 2020
If we want to go with that kind of approach, a Symbol-based option may be better...
addaleax commentedon Jun 30, 2020
Fwiw, I’m taking the Symbol-based approach (because I think information about headers should be passed in the headers object), but I’m not sure if we really want this kind of subdivision – if one of the cookie headers is sensitive, it’s probably okay to mark the others as sensitive as well.
http2: add support for sensitive headers
http2: add support for sensitive headers
http2: add support for sensitive headers
http2: add support for sensitive headers
http2: add support for sensitive headers
http2: add support for sensitive headers