GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http: forward-port pending-read fix (CVE-2026-105481) to lib/internal/http/agent.js by emyei · Pull Request #67073 · nodejs/node

Conversation

@emyei

@emyei emyei commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The hardening added for CVE-2026-105481 (commit 0683ee5, "http: ensure agent data guard works without I/O", shipped in v26.12.1) checks the OS directly for a pending read before a kept-alive socket is reused, closing the window where a peer's premature response could be delivered as the answer to the next request on the same connection.
  • That fix landed in lib/_http_agent.js on the release branches. Five days earlier, PR lib: deprecate _http_* #58535 had already moved the Agent implementation to lib/internal/http/agent.js on main, and the security fix was never forward-ported there — so main (and any v27 nightly) currently lacks this protection even though every supported release line (22.x/24.x/26.x) has it.
  • This PR restores the complete fix on main: the hasPendingRead() helper and its two call sites in lib/internal/http/agent.js (ported to the file's current structure), the unchanged lib/internal/tls/wrap.js proxy entry and src/stream_wrap.cc/.h native implementation (both already apply cleanly, byte-for-byte identical to the original fix), and the regression test test/parallel/test-http-agent-free-socket-pending-read.js that was dropped along with it.

Why now, in the open

No information here is under embargo: the original fix and its CVE have been public since 2026-10-20, and no supported/published Node.js version is affected — only main and nightlies built from it, which are not for production use. The goal is simply to close the gap before a 27.x release ships without this protection.

Test plan

  • node --check on the three modified/added JS files (syntax-verified in this environment, which does not have a full build toolchain for this repo set up).
  • Confirmed git apply --check of the original stream_wrap.cc/.h and tls/wrap.js hunks against current main — they apply unchanged.
  • Confirmed (via lib/internal/http/agent.js diff review) that the ported addRequest/on('free', ...) call sites match the structure and intent of the original lib/_http_agent.js fix.
  • CI: test/parallel/test-http-agent-free-socket-pending-read.js exercises both regression paths (free-pool reuse and direct hand-off to a queued request) and should be run by the project's build to confirm the native HasPendingRead binding links and behaves as expected on all platforms.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/net
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem. labels Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

  • the guide for first-time contributors
  • the contribution and automation policies
  • the pull request guide
  • the AI use policy
  • the Code of Conduct

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pimterry

pimterry commented Oct 28, 2026

Copy link
Copy Markdown
Member

Thanks for opening this, good catch @emyei! Agreed, we should merge this ASAP.

CC @jasnell who did the original security patch, but this looks like a clean port to me.

Right now the commit message linting is failing though, can you update that and force push? If you want to validate a commit message locally, you can do so with git rev-parse HEAD | xargs npx -q core-validate-commit --no-validate-metadata --tap (to check commit HEAD).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.70%. Comparing base (ec7a28f) to head (f60d783).
⚠️ Report is 273 commits behind head on main.

Files with missing lines Patch % Lines
src/stream_wrap.cc 60.00% 2 Missing and 6 partials ⚠️
lib/internal/http/agent.js 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67073      +/-   ##
==========================================
+ Coverage   90.65%   90.70%   +0.05%     
==========================================
  Files         797      801       +4     
  Lines      278482   281924    +3442     
  Branches    53559    54329     +770     
==========================================
+ Hits       252445   255717    +3272     
+ Misses      16393    16345      -48     
- Partials     9644     9862     +218     
Files with missing lines Coverage Δ
lib/internal/tls/wrap.js 95.68% <100.00%> (+0.06%) ⬆️
src/stream_wrap.h 100.00% <ø> (ø)
lib/internal/http/agent.js 96.63% <96.29%> (-0.02%) ⬇️
src/stream_wrap.cc 86.10% <60.00%> (-2.19%) ⬇️

... and 150 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pimterry

pimterry commented Nov 3, 2026

Copy link
Copy Markdown
Member

I'd like to get this merged sooner rather than later. @emyei do you mind updating the commit message? If not, in a few days I'll patch up the commit message and finish this myself.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@emyei @pimterry
http: forward-port the pending-read fix for CVE-2026-105481
f60d783
The Agent data guard only runs once the event loop polls for I/O. Data
that reaches an idle kept-alive socket's OS buffer right before that
poll can be handed to the next request as if it were that request's
own response (response-queue poisoning).

Commit 0683ee5 ("http: ensure agent data guard works without I/O",
CVE-2026-105481) fixed this by checking the OS directly via a new
LibuvStreamWrap::HasPendingRead before reusing a free socket. It
landed in lib/_http_agent.js on the release branches (shipped in
v26.12.1) but was never forward-ported after PR nodejs#58535 moved the Agent
implementation to lib/internal/http/agent.js on main five days
earlier. As a result, main (and any v27 nightly built from it) lost
the protection even though every supported release line (22.x/24.x/
26.x) still has it.

This restores the complete fix on main:
- lib/internal/http/agent.js: re-add the hasPendingRead() helper and
  its two call sites (the free socket handed to a queued request, and
  the free-pool socket selected in addRequest), ported 1:1 to the
  current structure of the file.
- lib/internal/tls/wrap.js, src/stream_wrap.cc/.h: unchanged from the
  original fix, which already applies cleanly on main.
- test/parallel/test-http-agent-free-socket-pending-read.js: restore
  the regression test covering both assignment paths, so the fix
  cannot be silently dropped again by a future refactor.

Fixes: https://hackerone.com/reports/4038361
CVE-ID: CVE-2026-105481

Co-authored-by: Tim Perry <[email protected]>
Signed-off-by: Tim Perry <[email protected]>
@pimterry
pimterry force-pushed the http-forward-port-pending-read-fix branch from 85e07cd to f60d783 Compare November 12, 2026 17:26
pimterry
pimterry approved these changes Nov 12, 2026
View reviewed changes

@pimterry pimterry left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've force pushed to sign this myself to fix the commit message (under 'b' from the DCO, I think I can sign this off as closely based on existing code we've already merged).

I'll land once CI etc passes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pimterry pimterry added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 12, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 12, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79005/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pimterry pimterry added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 12, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 12, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79017/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pimterry pimterry added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 13, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 13, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79031/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Nov 14, 2026
View reviewed changes
@pimterry pimterry added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 15, 2026
@github-actions github-actions Bot added resume-ci-failed Resuming CI with the resume-ci label failed and requires manual intervention. and removed resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. labels Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Failed to resume CI

✖ Failed to load PR CI job 79031: Unexpected token '<', ..."

Full Auto Start CI output
�[36m⠋�[39m Validating Jenkins credentials
�[36m⠋�[39m Validating Jenkins credentials
✔  Jenkins credentials valid
�[36m⠙�[39m Looking for CI runs for pull request 67073
�[36m⠙�[39m Looking for CI runs for pull request 67073
�[36m⠙�[39m Getting PR from nodejs/node/pull/67073
�[36m⠙�[39m Getting reviews from nodejs/node/pull/67073
�[36m⠙�[39m Getting comments from nodejs/node/pull/67073
✔  Found PR CI job 79031
�[36m⠹�[39m Querying data for job/node-test-pull-request/79031/
�[36m⠹�[39m Querying data for job/node-test-pull-request/79031/
�[36m⠹�[39m Querying API for job/node-test-pull-request/79031/

[DEBUG] [SyntaxError: Unexpected token '<', ..."    
  
  <!DOCTYPE "... is not valid JSON]
✖  Failed to load PR CI job 79031: Unexpected token '<', ..."    
  
  <!DOCTYPE "... is not valid JSON

View workflow run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pimterry pimterry added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed resume-ci-failed Resuming CI with the resume-ci label failed and requires manual intervention. labels Nov 16, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79161/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pimterry pimterry added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 17, 2026
@nodejs-github-bot
nodejs-github-bot merged commit bf07bea into nodejs:main Nov 17, 2026
80 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Landed in bf07bea

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 17, 2026
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@emyei @pimterry @aduh95
http: forward-port the pending-read fix for CVE-2026-105481
67ae162
The Agent data guard only runs once the event loop polls for I/O. Data
that reaches an idle kept-alive socket's OS buffer right before that
poll can be handed to the next request as if it were that request's
own response (response-queue poisoning).

Commit 0683ee5 ("http: ensure agent data guard works without I/O",
CVE-2026-105481) fixed this by checking the OS directly via a new
LibuvStreamWrap::HasPendingRead before reusing a free socket. It
landed in lib/_http_agent.js on the release branches (shipped in
v26.12.1) but was never forward-ported after PR #58535 moved the Agent
implementation to lib/internal/http/agent.js on main five days
earlier. As a result, main (and any v27 nightly built from it) lost
the protection even though every supported release line (22.x/24.x/
26.x) still has it.

This restores the complete fix on main:
- lib/internal/http/agent.js: re-add the hasPendingRead() helper and
  its two call sites (the free socket handed to a queued request, and
  the free-pool socket selected in addRequest), ported 1:1 to the
  current structure of the file.
- lib/internal/tls/wrap.js, src/stream_wrap.cc/.h: unchanged from the
  original fix, which already applies cleanly on main.
- test/parallel/test-http-agent-free-socket-pending-read.js: restore
  the regression test covering both assignment paths, so the fix
  cannot be silently dropped again by a future refactor.

Fixes: https://hackerone.com/reports/4038361
CVE-ID: CVE-2026-105481

Co-authored-by: Tim Perry <[email protected]>
Signed-off-by: Tim Perry <[email protected]>
PR-URL: #67073
Reviewed-By: Tim Perry <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@emyei @pimterry @gabylb
http: forward-port the pending-read fix for CVE-2026-105481
819f724
The Agent data guard only runs once the event loop polls for I/O. Data
that reaches an idle kept-alive socket's OS buffer right before that
poll can be handed to the next request as if it were that request's
own response (response-queue poisoning).

Commit 0683ee5 ("http: ensure agent data guard works without I/O",
CVE-2026-105481) fixed this by checking the OS directly via a new
LibuvStreamWrap::HasPendingRead before reusing a free socket. It
landed in lib/_http_agent.js on the release branches (shipped in
v26.12.1) but was never forward-ported after PR nodejs#58535 moved the Agent
implementation to lib/internal/http/agent.js on main five days
earlier. As a result, main (and any v27 nightly built from it) lost
the protection even though every supported release line (22.x/24.x/
26.x) still has it.

This restores the complete fix on main:
- lib/internal/http/agent.js: re-add the hasPendingRead() helper and
  its two call sites (the free socket handed to a queued request, and
  the free-pool socket selected in addRequest), ported 1:1 to the
  current structure of the file.
- lib/internal/tls/wrap.js, src/stream_wrap.cc/.h: unchanged from the
  original fix, which already applies cleanly on main.
- test/parallel/test-http-agent-free-socket-pending-read.js: restore
  the regression test covering both assignment paths, so the fix
  cannot be silently dropped again by a future refactor.

Fixes: https://hackerone.com/reports/4038361
CVE-ID: CVE-2026-105481

Co-authored-by: Tim Perry <[email protected]>
Signed-off-by: Tim Perry <[email protected]>
PR-URL: nodejs#67073
Reviewed-By: Tim Perry <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@pimterry pimterry pimterry approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@emyei @nodejs-github-bot @pimterry @jasnell
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.