Conversation
|
Review requested:
|
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66288 +/- ##
==========================================
- Coverage 90.37% 90.35% -0.02%
==========================================
Files 790 790
Lines 273807 273850 +43
Branches 52367 52389 +22
==========================================
- Hits 247446 247441 -5
- Misses 16869 16918 +49
+ Partials 9492 9491 -1
🚀 New features to boost your workflow:
|
|
This PR is failing linting tests. See the comments in the tests for more detail. See also Pull requests > Step 6: Test with further details in the linked document section BUILDING > Running tests.
|
Per-request rejectUnauthorized/ca/servername were silently ignored when the https.Agent set the same option, because http.Agent merges request options over the agent's own, letting the agent win. Capture the per-request overrides and re-apply them in createConnection(), mirroring the checkServerIdentity handling from CVE-2026-58040. Refs: nodejs@52a8ace880d Signed-off-by: axedos <acceleratingssoul@proton.me>
7145186 to
14b61cb
Compare
Per-request TLS options passed to
https.request() / https.get()are silentlyignored when the
https.Agentin use was constructed with the same option.http.Agentmerges the request options over the agent's own options, lettingthe agent's value win.
That is surprising and can weaken security for TLS options in particular: a
per-request
rejectUnauthorized: trueon an agent configured withrejectUnauthorized: falsestill sends the request with certificateverification disabled. The same applies to ca and servername.
CVE-2026-58040 already handled this for
checkServerIdentityby tagging therequest so the socket is not reused. This change generalizes that approach:
when a per-request rejectUnauthorized, ca, or servername differs from the
agent's value, request() captures the override and createConnection()
re-applies it, and the socket is not reused.
Refs: 52a8ace880d