Commit Graph
18484 Commits
Author SHA1 Message Date
Yagiz Nizipli 07b0481f49 test: update WPT for url to 2fa965b55c
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
Assisted-by: Grok
PR-URL: https://github.com/nodejs/node/pull/67624
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-11-21 18:57:43 +00:00
Matteo Collina 08eff138e3 stream: stop reusing a detached onread buffer
CustomBufferJSListener keeps only the raw address (uv_buf_t) of the
user-supplied onread buffer, without retaining the backing store. If
application code transfers (and thereby detaches) that buffer during the
onread callback, for example by enqueuing a view into a byte
ReadableStream, the backing store is moved away from under the listener
and the raw address is left dangling. Reading subsequent peer data into
that address then corrupts memory the application owns, and if the
backing store is later released, it becomes a use-after-free.

Retain the backing store in CustomBufferJSListener so the raw address
never dangles, and stop reading when the onread callback detaches the
buffer so the stale address is not handed back to libuv.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67542
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-21 16:33:22 +00:00
jakecastelliandMikhail Leliakin 6d426a0494 http2: add missing setHeaders
Make it possible to invoke response.setHeaders() on the
Http2ServerResponse object, matching the http.OutgoingMessage API.

Fixes: https://github.com/nodejs/node/issues/51573
Refs: https://github.com/nodejs/node/pull/51576
Signed-off-by: jakecastelli <38635403+jakecastelli@users.noreply.github.com>
Signed-off-by: Mikhail Leliakin <leliakin@canva.com>
Co-authored-by: Mikhail Leliakin <leliakin@canva.com>
Assisted-by: Cursor
PR-URL: https://github.com/nodejs/node/pull/67597
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-21 15:21:55 +00:00
Filip Skokan 93078b41d3 test: use FIPS-compatible PBKDF2 inputs
Fixes: https://github.com/nodejs/node/issues/67673
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67675
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2026-11-21 13:00:29 +00:00
Matteo Collina 06250cba58 test: limit concurrency in gc-http-client tests
The tests started one request chain per CPU, each issuing a new request
on every event loop turn until the first response arrived. On a loaded
macOS host this put more than 128 connections in flight, overflowing
the listen queue. The kernel then drops an incomplete connection and
answers its final ACK with a RST, so the client fails with
`connect ECONNRESET`.

Use a fixed number of concurrent requests and a fixed total instead.

Drive-by: the error handler in test-gc-http-client-onerror rethrows,
fix the comment that says it does nothing.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67607
Refs: https://github.com/nodejs/node/issues/41399
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-21 10:54:19 +00:00
Max Fisher a6dcfec130 repl: redraw highlighted input once per chunk
Signed-off-by: Max H Fisher <mfisher187@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67422
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-21 04:17:55 +00:00
Ethan Arrowood 17dab26e13 doc,test: clarify http1 insecure validation
The httpValidation docs said 'insecure' disables all header value
validation. That wasn't entirely true. It only did so for incomming
messages (which are parsed with all --insecure-http-parser leniency
flags). Outgoing header values are still validaed as in 'relaxed'
mode. This comes from the design in https://github.com/nodejs/node/pull/61597

This change corrects the docs and adds some tests to assert the
expected behavior

Refs: https://github.com/nodejs/node/pull/61597
Refs: https://github.com/nodejs/node/pull/63571
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ethan Arrowood <ethan@arrowood.dev>
PR-URL: https://github.com/nodejs/node/pull/67560
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-20 21:17:28 +00:00
Manzoor Wani 77fdeb6fa0 src: fix hang when joining workers in process.exit()
V8 background jobs, such as concurrent Sparkplug and Maglev compiles,
can run into the heap limit. They then post a GC request to the main
thread and park in CollectionBarrier::AwaitCollectionBackground()
until the main thread collects garbage or the isolate is torn down.

process.exit() does neither. DefaultProcessExitHandlerInternal()
calls DisposePlatform() while the isolate is still alive and not
running JS, and NodePlatform::Shutdown() joins the worker threads.
A worker that is parked at that point never wakes up, and the join
hangs forever.

Pass the exiting isolate down to NodePlatform::Shutdown(). While the
workers finish their current tasks, the main thread checks every
10ms whether a foreground task was posted for that isolate. If so,
it drops the queued tasks, which would never run on this path, and
performs a GC so that the parked workers can finish. Normal exits
dispose the isolate before the platform and are not affected.

Fixes: https://github.com/nodejs/node/issues/64274
Signed-off-by: Manzoor Wani <manzoorwani.jk@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66171
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-20 21:05:09 +00:00
Rafael Gonzaga 3fda34e186 fs: do not disable fd-based APIs in permission audit mode
Refs: https://github.com/nodejs/node/pull/65659
Refs: https://github.com/nodejs/node/issues/65419
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66726
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-20 19:25:20 +00:00
Rafael Gonzaga a506755812 permission: drop fs grants regardless of the path's current type
Revoking a grant re-checked whether the path is a directory, so a path
that changed type after startup no longer matched the stored grant and
the drop was a silent no-op. Match both the plain and the wildcard form.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66766
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-20 19:25:07 +00:00
Shelley Vohr dcaf43a167 module: disable the compile cache while V8 coverage is collected
V8 cannot collect block coverage for functions that are deserialized
from the code cache, so it only reports how many times each of them
ran. With a warm compile cache, branches that never ran inside those
functions are reported as covered, and tools that merge reports from
several processes can report functions that ran as never run.

The documentation recommended turning the cache off by hand. Do it
automatically when coverage collection starts with the process, through
NODE_V8_COVERAGE or --experimental-test-coverage.

The compile cache tests stop propagating NODE_V8_COVERAGE to the
processes they spawn, so that they keep working when the test suite
itself runs with coverage.

Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67120
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-20 14:59:50 +00:00
Aviv Keller 030745c54e test_runner: junit fixes
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/67160
Fixes: https://github.com/nodejs/node/issues/67155
Fixes: https://github.com/nodejs/node/issues/67149
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-20 13:56:15 +00:00
Efe Karasakal 5884b8e766 quic: honor enableEarlyData on servers
Signed-off-by: Efe Karasakal <hi@efe.dev>
PR-URL: https://github.com/nodejs/node/pull/67562
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-20 08:41:26 +00:00
Paolo Insogna 50ba1ec6c2 worker: add diagnostic channel 'worker_threads.main.registry'
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
Assisted-By: OpenAI:GPT-6.1 Sol <openai/gpt-6.1-sol>
PR-URL: https://github.com/nodejs/node/pull/67311
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-20 06:53:49 +00:00
Livia Medeiros 04824484d6 test: restrict os.tmpdir() in favour of common/tmpdir
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67567
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-20 05:26:57 +00:00
Filip Skokan 17443a3af7 crypto: align hash() invalid XOF length errors
Use the same error as createHash() when outputLength differs from a
fixed-size digest's length. Preserve acceptance of the exact length.

Assisted-by: Codex
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67565
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-19 23:37:31 +00:00
Filip Skokan b85995ce81 test: cover crypto provider parameters
Cover binary and empty digest customization, incompatible parameter
types, and MAC descriptor selection with a shared test provider.
Check UTF-8 termination for byte inputs.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67565
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-19 23:37:30 +00:00
Filip Skokan 360bd63c6c crypto: use settable parameter descriptors
Resolve the exposed digest options against provider descriptors and
construct UTF-8 or octet strings according to their advertised types.
Keep binary values intact for octet strings and reject NUL bytes for
UTF-8 strings.

Share hash initialization and one-shot input/output handling while
retaining the plain digest fast paths and XOF length checks. Probe RSA
implicit rejection without changing its context.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67565
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-19 23:37:28 +00:00
Guilherme Araújo f0eb690cf1 sqlite: avoid resetting a finalized statement
run() and get() reset a cached statement pointer on exit. Throwing an
error can run an Error.prototype setter that closes the database and
frees it. Reset through the Statement, which Finalize() clears.

Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67557
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-19 19:24:27 +00:00
Marten Richter 3521a6e311 quic: add option waitUntilAvailable to creating streams
We add an option to createBidirectionalStream and
createUnidirectionalStream to fail immediately,
if the flow control's stream budget does not
allow stream creation.
The behavior matches W3C webtransport's behavior.

Fixes #65321

Signed-off-by: Marten Richter <marten.richter@freenet.de>
PR-URL: https://github.com/nodejs/node/pull/65331
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-19 19:14:32 +00:00
Tim Perry eda8de765b http2: don't fail response reads after clean RST_STREAM
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67558
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-19 19:14:15 +00:00
Vlad Frangu 42800b60d3 os: expose guessFileDescriptorType
Exposes the internal `guessHandleType` function as
`guessFileDescriptorType`, which can be used to see if a handle has a
specific type, regardless of the OS it is on.

This helps out with detecting, for example, if standard input is piped
into the process, instead of relying on file system calls.

Refs: https://github.com/nodejs/node/issues/57603
Signed-off-by: Vlad Frangu <me@vladfrangu.dev>
PR-URL: https://github.com/nodejs/node/pull/58060
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-11-19 10:46:13 -07:00
Tim Perry db671bb416 http2: fix eos() for HTTP/2 streams after clean end & close
Previously this could fail - not having read 'end' when the close
arrived was treated as a premature close error for finished() and
related APIs, even though the body data was cleanly ended and complete.
We now check whether there is a clean end buffered. If so, we wait
until it's read before evaluating whether the stream ended cleanly.

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67553
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-19 17:41:27 +00:00
Ethan Arrowood 88b034fa75 quic: fix h3 session close on early stream destroy
If the stream is destroyed right after sendHeaders(), nghttp3 still has
the response headers queued. On the next write it asks for the removed
stream's body, the read callback fails, and the whole session closes
without notifying the peer.

In an HTTP/3 session, before clearing nghttp3's pointer to a stream when
the stream is destroyed, shut down nghttp3's writes for that stream so
that other requests can continue to complete.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ethan Arrowood <ethan@arrowood.dev>
PR-URL: https://github.com/nodejs/node/pull/67446
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-19 17:13:16 +00:00
Ethan Arrowood 86b9e3544c http,http2: copy header arrays in setHeader
setHeader() stored the caller's array and that led to mutation
issues with appendHeader() pushing new values into it. The caller
would see values added to that array, and if the array was frozen
appendHeader() would throw a TypeError.

This fix copies the array value instead so the response instance
owns it completely. getHeader() still return the stored array.

It also applies the same change to HTTP2 compat api.

Fixes: https://github.com/nodejs/node/issues/67526
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ethan Arrowood <ethan@arrowood.dev>
PR-URL: https://github.com/nodejs/node/pull/67528
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-19 16:50:31 +00:00
Yuya Inoue f442b5a232 http2: add callback to informational header methods
In the HTTP/1 server, writeContinue(), writeEarlyHints() and
writeInformation() accept a callback that is called once the response
has been written to the socket. The HTTP/2 compat versions did not, so
code moving to the compat API had its callback ignored.

Accept an optional callback in http2stream.additionalHeaders() and in
the three compat methods. The request for the HEADERS frame is tracked
until nghttp2 serializes the frame, and completed together with the
write to the underlying stream that carries it.

Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/67470
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-19 16:39:21 +00:00
Jacky Zhao 0c8797b2a6 module: don't map a trailing generated-only segment
The mappings parser detects a segment that has only a generated column
by peeking at the next character. At the end of the mappings string the
peek returns an empty string, which is not a separator, so a final
generated-only segment is decoded with phantom zero deltas and inherits
the source, line, and column of the segment before it. With
--enable-source-maps, stack frames in code after the last mapped
segment are then attributed to the last mapped source.

Check for the end of the string before reading source fields.

Signed-off-by: Jacky Zhao <j.zhao2k19@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66264
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-19 15:50:19 +00:00
Joyee Cheung ab55d75c43 test: make test-v8-collect-gc-profile-minor-ms more robust
There can be more than one garbage collection triggered by
one gc() call and it's not controllable by Node.js.
Update the assertion to check that at least one expected
GC is there, but don't check that there aren't more.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67547
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-19 15:40:46 +00:00
Michaël ZassoandJoyee Cheung 697c575af4 src,test: use non-deprecated v8::FunctionCallbackInfo::DataV2 API
Co-Authored-By: Joyee Cheung <joyeec9h3@gmail.com>
Signed-Off-By: Michaël Zasso <targos@protonmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67070
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-11-19 10:34:49 -05:00
Chengzhong Wu 5cefeb1dc8 test: remove test on --harmony-struct
V8 deprecated --harmony-struct.

Refs: https://chromium-review.googlesource.com/c/v8/v8/+/8610686
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67070
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-11-19 10:34:43 -05:00
Trivikram Kamat d9e18d51d5 vfs: normalize RealFSProvider mkdir return paths
RealFSProvider.mkdirSync()/mkdir() forwarded the raw fs.mkdirSync()
result, which for { recursive: true } is the absolute backing-directory
path of the first created directory. VirtualFileSystem#toMountedPath()
then joined the mount point with it, producing <mount>/<root>/a instead
of <mount>/a, so the returned path failed fs.existsSync().

Reuse the existing #resolvedToVfsPath() helper (as realpath does) to
translate the result back to a provider-relative VFS path, matching
MemoryProvider.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: opencode
PR-URL: https://github.com/nodejs/node/pull/66221
Fixes: https://github.com/nodejs/node/issues/66220
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-19 08:20:45 +00:00
Matteo Collina c47b8d8781 url: restrict option copying in urlToHttpOptions to URL instances
Only spread own enumerable properties for URL instances created by this
realm's URL constructor. Duck-typed objects accepted by isURL() can no
longer smuggle connection options (socketPath, method, headers, agent)
into a request.

This fixes a footgun where a hostname-validated http.request() could be
redirected to a Unix socket (e.g. the Docker daemon) via a URL-shaped
object, bypassing hostname-based SSRF checks. Extending a genuine URL
object with extra options is preserved.

Refs: https://github.com/nodejs/node/pull/46989
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67454
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-19 08:20:21 +00:00
Ved Chaudhari cdd06876da fs: restore stack traces of fs/promises stat permission errors
Since stat() started going through raceWithSignal(), permission
errors from fsPromises.stat() have had no stack frames. The binding
rejects them right away, and raceWithSignal() returned that promise
from an async function without awaiting it, so nothing was awaiting
it yet when the stack was captured.

Return the promise as is when there is no signal, so stat() awaits
it directly again.

Refs: https://github.com/nodejs/node/pull/63143
Signed-off-by: vedchaudhari <vedc2853@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67525
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-19 03:40:55 +00:00
inoway46 371ac095ac tls: destroy sockets after fatal errors
Destroy established TLS sockets on fatal errors so pending writes
cannot prevent HTTP/2 session cleanup from completing. Defer closing
until after error handling to preserve connection details for listeners.

Add regression coverage for standalone TLS socket closure and HTTP/2
cleanup with default and custom TLS connections.

Fixes: https://github.com/nodejs/node/issues/67213
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67215
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-19 02:21:25 +00:00
inoway46 3f61461631 net: clear closed handles before emitting close
Clear a deferred socket handle before invoking close listeners. TLS has
already freed its SSL state at this point, so retaining the handle lets
getProtocol() access a null SSL pointer and crash the process.

Keep connection details available during tlsClientError and add coverage
for querying the protocol after a failed handshake closes the socket.

Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67215
Fixes: https://github.com/nodejs/node/issues/67213
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-19 02:21:24 +00:00
Tim Perry b7df44bf9c tls: docs-deprecate TLS renegotiation, add allowRenegotiation opt-in
For now this changes very little, but offers an option to directly
control whether this is supported. In future, this will default to
'false' (disabling by default) and eventually be mostly removed,
except opt-in client support for accepting renegotiation requests
from servers.

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67532
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-18 22:39:56 +00:00
Christian Aurich Zanettini Martins d15ad82c29 quic: validate maxPayloadSize range
The maxPayloadSize option was copied into ngtcp2's
max_tx_udp_payload_size unchecked. ngtcp2 requires 1200 to 65527 and
only asserts it, so in a release build 0 gave the congestion controller
an empty initial window and the process died with SIGFPE in
ngtcp2_cc_cubic_init() when the connection was created. Values from 1
to 1199 were accepted and the session was destroyed before it opened.

Reject values outside that range when the session options are parsed,
for both connect() and listen().

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67531
Refs: https://github.com/nodejs/node/pull/65827
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-18 21:16:54 +00:00
Lazizbek Ergashev 5a823400b2 lib: end --eval crypto wrapper code with a newline
Assisted-by: Claude Code
Signed-off-by: lazerg <lazerg2@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67162
Fixes: https://github.com/nodejs/node/issues/67159
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-18 17:55:41 +00:00
Ravi Arnan Irianto dd425b79bf test: fix zipinfo non-ascii check in test-zlib-zip-interop
Keep UNICODE_SUPPORT guard so macOS skips checking non-ASCII names
in zipinfo output, and accept '?' / U+FFFD placeholders on builds
with UNICODE_SUPPORT that filter non-ASCII bytes in fnfilter()
without wide-character printing support (such as NixOS or Gentoo).

Fixes: https://github.com/nodejs/node/issues/66975
Signed-off-by: Ravi Arnan <raviarnankeren@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66978
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Philipp Dunkel <pip@pipobscure.com>
2026-11-18 13:18:53 +00:00
Matteo Collina 273f2176a3 sea: add source maps for SEA with VFS
SEA binaries built with "useVfs" can now load source maps from the
bundled assets (or the "vfsArchive" archive) and apply them to stack
traces and error output, because fs reads are routed through the virtual
file system mounted by the SEA.

Add two tests covering the inline-assets and zip-archive VFS paths, each
asserting that findSourceMap() resolves against the mount point and that
a thrown error's frame and source line are remapped to the original
source. Also document how to enable and bundle source maps in a SEA.

Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67503
Reviewed-By: Philipp Dunkel <pip@pipobscure.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-18 13:18:32 +00:00
Stewart X Addison ab5fac79ac build: fix AIX shared library exports generation
Signed-off-by: Stewart X Addison <sxa@ibm.com>
Assisted-by: Cursor
PR-URL: https://github.com/nodejs/node/pull/67359
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-18 12:50:56 +00:00
James M Snell d77ed7854e fs: move DEP0187 to End-of-Life
Passing an invalid argument type to fs.existsSync() now throws
ERR_INVALID_ARG_TYPE instead of returning false. Other invalid paths,
such as strings containing null bytes or non-file: URLs, continue to
return false.

This has been a runtime deprecation since v24.0.0.

Refs: https://github.com/nodejs/node/pull/55753
Refs: https://github.com/nodejs/node/pull/55892
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67494
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-18 12:02:29 +00:00
Marcel f8dd0aae2f test: fix on zfs build host
Signed-off-by: Marcel <me@m4rc3l.de>
PR-URL: https://github.com/nodejs/node/pull/67517
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-18 11:43:12 +00:00
Antoine du Hamel 528ff04af5 test: reduce flakiness of test-worker-memory
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67513
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
2026-11-18 09:48:31 +00:00
Antoine du Hamel c463765478 test: ignore ECONNRESET in test-gc-net-timeout
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67514
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-18 09:48:19 +00:00
Moshe Atlow 20a93ab52b test_runner: scope rerun ids to the entry file
With process isolation, the `--test-rerun-failures` state file is
written by the parent process, which numbered tests sharing a location
across all test files, while each child process numbers them within
its own file. A test defined in a helper used by several test files
was therefore looked up in a slot belonging to another file, and a
failing test could be replayed as passed without running.

Prefix the identifier of a test defined outside of its entry file with
the entry file when tests run in per-file child processes, and build
the identifier with the same helper on both sides.

Signed-off-by: Moshe Atlow <moshe@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/67512
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2026-11-18 09:39:47 +00:00
Moshe Atlow 19cb394896 test_runner: resolve entryFile against the cwd option
The location of a test file run in a child process was resolved
against `process.cwd()`, so `run()` reported a wrong `entryFile` for
relative paths when called with a different `cwd`.

Signed-off-by: Moshe Atlow <moshe@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/67512
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2026-11-18 09:39:46 +00:00
Efe Karasakal 3e797cbda2 quic: handle application-specific no-error codes
Signed-off-by: Efe Karasakal <hi@efe.dev>
PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-18 07:50:23 +00:00
Matteo Collina 93053532e8 stream: keep async context of the pipeTo pump
The pipeTo() pump re-enters from the destination's ready hook, which
writableStreamUpdateBackpressure invokes synchronously, and from the
chunk steps of its read request. Both run in the async context of the
code that cleared the backpressure or enqueued the chunk, so the
source's pull() and the writes issued after a resumption observed that
context instead of the one of the pipeTo() call, as they did with the
promise-based pump. Capture the async context frame when the pipe starts
and run the pump in it.

Refs: https://github.com/nodejs/node/issues/66906
Refs: https://github.com/nodejs/node/pull/65138
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67054
Refs: https://github.com/nodejs/node/pull/67052
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-18 06:45:33 +00:00
Yohannes Desta 1fb0cd6978 fs: validate opendir() bufferSize before opening the directory
fs.opendir() only checked options.bufferSize in the Dir constructor,
which runs from the completion callback of the native opendir call.
An invalid value was thrown from there, so it could not be caught and
the process exited. fs.promises.opendir() is built on fs.opendir() and
had the same problem.

Check bufferSize before starting the native call, so fs.opendir()
throws to the caller and fs.promises.opendir() rejects.

Fixes: https://github.com/nodejs/node/issues/67182
Signed-off-by: Yohannes Desta <yohannesdestagebru10@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67183
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-18 03:59:25 +00:00