http: make req.headers have a null prototype#62900
Open
mcollina wants to merge 3 commits intonodejs:mainfrom
Open
http: make req.headers have a null prototype#62900mcollina wants to merge 3 commits intonodejs:mainfrom
mcollina wants to merge 3 commits intonodejs:mainfrom
Conversation
Makes IncomingMessage.prototype.headers and trailers have a null prototype, matching the existing behavior of headersDistinct and trailersDistinct. Fixes prototype pollution concerns where headers like __proto__ could be interpreted as prototype manipulation. Refs: nodejs#61771 PR-URL: nodejs#61772
Collaborator
|
Review requested:
|
ljharb
approved these changes
Apr 22, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62900 +/- ##
==========================================
+ Coverage 89.61% 89.63% +0.01%
==========================================
Files 706 706
Lines 219136 219203 +67
Branches 41981 41998 +17
==========================================
+ Hits 196376 196478 +102
+ Misses 14671 14618 -53
- Partials 8089 8107 +18
🚀 New features to boost your workflow:
|
Qard
approved these changes
Apr 23, 2026
gurgunday
approved these changes
Apr 23, 2026
In HTTP/2 compatibility mode, make request trailers have a null prototype, matching the behavior of regular headers and trailers.
fcc3070 to
8c7c040
Compare
pimterry
approved these changes
Apr 23, 2026
panva
approved these changes
Apr 23, 2026
Collaborator
watilde
approved these changes
Apr 23, 2026
Renegade334
approved these changes
Apr 23, 2026
lpinca
reviewed
Apr 23, 2026
| })); | ||
| } | ||
|
|
||
| // Test 2: req.trailers has a null prototype |
Member
There was a problem hiding this comment.
I can't see where this is checked, am I missing something?
b202d30 to
6e4f221
Compare
6e4f221 to
3a57b11
Compare
lpinca
approved these changes
Apr 23, 2026
marco-ippolito
approved these changes
Apr 23, 2026
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.
Make req.headers and req.trailers in http.createServer() have a null prototype, matching the existing behavior of headersDistinct and trailersDistinct. Also applies the same fix to HTTP/2 compatibility mode for req.trailers.