Repository navigation
fix(client): reset no-body transfer-encoding responses - #126
Merged
ronag merged 1 commit intoOct 8, 2026
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused parser change addresses the vulnerability and is covered across the relevant response and dispatch modes.
0 open findings
What changed in this PR
Prevents HTTP/1 response-queue poisoning when bodyless 204/304 responses include Transfer-Encoding.
Changes:
- Tracks
Transfer-Encodingduring response parsing. - Disables connection reuse for affected 204/304 responses.
- Adds regression coverage for blocking and pipelined requests.
| File | Description |
|---|---|
lib/dispatcher/client-h1.js |
Detects unsafe responses and resets their connections. |
test/client-304-content-length.js |
Tests 204/304 handling across blocking modes. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
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.
Summary
This adapts nodejs/undici#5941 to the slim HTTP/1 transport. The downstream baseline accepted the injected trailing response in all four regression cases.
Upstream head reviewed: 0191eab.
Downstream base: 2d840d6.
Validation
Exact candidate:
a1f7876d6ba0321afe4f02ea2085ef28f2984c5d, Node.js 26.10.0.nxtedition/node@sha256:8a47e2410fbb9718c3196525e9b35227e916e3dcae06c138f42786d22b1aae4f. The full unit suite used ordinary Docker DNS for the reserved.invalidlookup fixture; the no-network run stalled at that same existing test on both base and candidate.A legitimate 304 response may carry Transfer-Encoding under RFC 9112 §6.1; this change conservatively closes that connection to protect the response queue. HEAD handling retains the existing behavior.
No exact-head CI checks or commit statuses are currently reported.