Commit Graph
49825 Commits
Author SHA1 Message Date
Chengzhong Wu 949f252ce8 esm: unflag --experimental-import-text
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67778
Fixes: https://github.com/nodejs/node/issues/67267
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Efe Karasakal <hi@efe.dev>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-11-27 16:04:43 +00:00
Christian Aurich Zanettini Martinsandlazerg 2fdac690b4 sqlite: fix abort on oversized SQL text
`expandedSQL`, `sourceSQL`, column names and the `sqlite.db.query`
trace callback passed SQL text to `String::NewFromUtf8()` without a
length, and V8 aborted on text longer than `String::kMaxLength`.
Pass the length instead. The getters and column names now throw
`ERR_STRING_TOO_LONG`, and the trace callback skips the event so the
statement still runs.

Co-authored-by: lazerg <lazerg2@gmail.com>
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67768
Fixes: https://github.com/nodejs/node/issues/66487
Refs: https://github.com/nodejs/node/pull/66498
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 13:33:24 +00:00
Yuya Inoue d8333204b6 http2: add signal to compat request
Add `request.signal` to `Http2ServerRequest`, matching
`message.signal` in HTTP/1. The signal follows the stream, not the
socket: it is aborted when the stream closes before the response has
been sent completely.

Refs: https://github.com/nodejs/node/pull/62541
Refs: https://github.com/nodejs/node/pull/64392
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Claude Code
PR-URL: https://github.com/nodejs/node/pull/67774
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 12:32:01 +00:00
Mohamed Sayed ec0dbaab8f fs: harden the one-round-trip read and write jobs
Signed-off-by: Mohamed Sayed <k@3zrv.com>
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67112
2026-11-27 12:33:16 +01:00
Aviv KellerandBrian Muenzenmeyer 08fbdb1273 build, doc: move to redesign
Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/66713
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-27 09:19:44 +00:00
Ilyas Shabi cef4391ab3 src: use V8 using declarations consistently
Signed-off-by: ishabi <ilyasshabi94@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67732
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 08:43:43 +00:00
LiviaMedeiros ae8312791d tools: restrict defining Symbol.[Async]Dispose functions as aliases
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67582
Refs: https://github.com/nodejs/node/blob/HEAD/doc/contributing/erm-guidelines.md#debuggability-of-disposer-methods
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-27 06:22:21 +00:00
LiviaMedeiros 4acb828ab7 lib: avoid defining Symbol.[Async]Dispose functions as aliases
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67582
Refs: https://github.com/nodejs/node/blob/HEAD/doc/contributing/erm-guidelines.md#debuggability-of-disposer-methods
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-27 06:22:20 +00:00
Manjeet Singh 0089699ae3 node-api: clear the pending exception before handling it
CallIntoModule() reset last_exception only after handle_exception()
returned. When handle_exception() reports the exception through
'uncaughtException', the listener runs while the exception is still
pending, so calling back into the module from it saw the same
exception again: an addon function failed with napi_pending_exception
and rethrew it, and a finalizer run by gc() in an experimental module
reported it a second time, which aborted the process with
"Re-entrant uncaught exception detected".

Take the exception out of last_exception before handling it.

Fixes: https://github.com/nodejs/node/issues/67421
Assisted-by: a coding agent
Signed-off-by: Manjeet Singh <024manjeetsingh@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67448
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-27 04:42:09 +00:00
Joyee CheungandChengzhong Wu eaf46fc7a9 src: migrate to SetEmbedderDataV3
V8 16.0 removes Context::SetEmbedderData() and
Context::SetEmbedderDataV2().

Refs: https://crrev.com/c/8687878
Co-Authored-By: Chengzhong Wu <cwu631@bloomberg.net>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67755
Refs: https://issues.chromium.org/issues/570436596
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 01:52:42 +00:00
Joyee CheungandChengzhong Wu 4f97fe8bff src: migrate to SetAlignedPointerInEmbedderDataV2
V8 16.0 removes Context::SetAlignedPointerInEmbedderData().

Refs: https://crrev.com/c/8687878
Co-Authored-By: Chengzhong Wu <cwu631@bloomberg.net>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67755
Refs: https://issues.chromium.org/issues/570436596
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 01:52:40 +00:00
Chengzhong Wu 5b47a78cd3 src,build: configure V8_EMBEDDER_DATA_ARRAY_SIZE
Refs: https://issues.chromium.org/issues/570436596
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67755
Refs: https://crrev.com/c/8687878
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 01:52:37 +00:00
Aviv Keller b663e55882 repl: fix promise regression
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/67721
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 21:56:09 +00:00
James M Snell 345e2b2fd7 crypto: move DEP0031 to End-of-Life
Remove ecdh.setPublicKey(). ECDH only requires a private key and the
other party's public key to compute a shared secret, and
ecdh.setPrivateKey() already derives and sets the associated public
key. The native ECDH setPublicKey binding is removed as well.

diffieHellman.setPublicKey() is unaffected.

This has been a runtime deprecation since v25.0.0 and a
documentation-only deprecation since v5.2.0.

Refs: https://github.com/nodejs/node/pull/58620
Refs: https://github.com/nodejs/node/pull/3511
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67493
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2026-11-26 13:16:55 -08:00
Aviv Keller 421ee55145 tools: link more targets with libatomic
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/66851
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-26 13:15:50 -07:00
Nigro Simone 3872251a16 src: add MakeCallback() taking an Environment
node::MakeCallback() looks up the Environment from the creation context
of the callback on every call. An addon that calls into the same
Environment many times, a server calling one handler per request for
example, can now take it once with GetCurrentEnvironment() and pass it.
The callback must belong to that Environment.

Add a benchmark, napi/make_callback_env, comparing the two overloads.

Refs: https://github.com/nodejs/performance/issues/24
Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66510
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 19:36:48 +00:00
James M Snell 691c528d95 module: move DEP0128 to End-of-Life
A package.json whose "main" entry cannot be resolved no longer falls
back to the package's top-level index file when loaded with require().
Instead, a MODULE_NOT_FOUND error is thrown, matching the existing
behavior for packages that have no index file.

This has been a runtime deprecation since v16.0.0.

Refs: https://github.com/nodejs/node/pull/37204
Refs: https://github.com/nodejs/node/pull/26823
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67487
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-26 11:18:50 -08:00
Ved Chaudhari 8592b1c8f3 permission: suggest --allow-fs-write in writeReport errors
process.report.writeReport() checks the fs.write permission in JS
and threw ERR_ACCESS_DENIED without the "Use --allow-fs-write to
manage permissions." hint that the other permission errors have.
Add it.

Refs: https://github.com/nodejs/node/pull/66969
Signed-off-by: vedchaudhari <vedc2853@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67681
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-11-26 19:16:31 +00:00
Yaroslav Chuhai c698e79e2e worker: fix error imports and receiver check in Web Locks
Signed-off-by: Yaroslav Chuhai <yaroslavchuhai@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67717
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 19:16:17 +00:00
Roberto Bianchi fa9600147d zlib: avoid mutable push in sync output collection
processChunkSync() and processSyncWithDefaults() collected output
chunks with buffers.push(), which looks up Array.prototype.push at call
time. Replacing that method from user code changed how synchronous zlib
calls such as gunzipSync() collected their output. Use indexed
assignments instead.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/67748
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 19:16:04 +00:00
Tim Perry 2dd55c3d47 quic: fix eternal handle leak for HTTP/3 known header names
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67758
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 18:01:46 +00:00
Yohannes Destaandwei_ds 31fff58ab2 fs: reject a mode above INT32_MAX instead of aborting
parseFileMode() accepted any 32-bit unsigned integer, but the native
bindings read the mode as a signed 32-bit integer and CHECK that it is
one. A mode between 2**31 and 2**32 - 1 therefore passed validation and
then aborted the process from fs.open(), fs.chmod(), fs.mkdir() and
their sync and promise variants. Validate the mode as a non-negative
Int32 instead so that the caller gets a RangeError.

ReadStream and WriteStream now validate options.mode in the constructor
too, so an invalid mode throws where the stream is created instead of
failing inside the open callback.

Fixes: https://github.com/nodejs/node/issues/62516
Refs: https://github.com/nodejs/node/pull/62538
Co-authored-by: wei_ds <wei_ds@126.com>
Signed-off-by: Yohannes Desta <yohannesdestagebru10@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67498
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:42:11 +00:00
Antoine du Hamel a3a45f571d tools: add linter rule to enforce use of SafePromiseAllReturnVoid
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67726
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:41:56 +00:00
Marten Richter 32d410cb10 quic: fix fix h3 session close on early str. destr
This fixes the fix from the PR #67446.
The previous PR did not allow already submitted
data, such as a Webtransport close capsule to be
transmitted to ngtcp2.
This PR instead uses the nullptr reader,
to detect a closed stream and signals eof.

This is of course only an intermediate solution,
instead quic RESET_AT semantics are a far better
solution.

Signed-off-by: Marten Richter <marten.richter@freenet.de>
PR-URL: https://github.com/nodejs/node/pull/67706
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-11-26 16:31:28 +00:00
Yuya Inoue 4d544ead13 doc: clarify PR closing keyword handling
Document that the landing tool accepts Closes: and Resolved: and records
them as Fixes: trailers.

Refs: https://github.com/nodejs/node/pull/67696#issuecomment-7101938071
Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67731
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:31:11 +00:00
Ved Chaudhari 3c15087582 lib,src: reset TextDecoder after a decoding error
A fatal decode() error now resets the decoder, as the Encoding
Standard requires, so the next call does not continue with the bytes
or BOM state from before the error.

Signed-off-by: vedchaudhari <vedc2853@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67610
Fixes: https://github.com/nodejs/node/issues/67604
Refs: https://github.com/whatwg/encoding/pull/369
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:19:32 +00:00
Roberto Bianchi 270d4f3651 stream: avoid mutable push in writable end callbacks
Writable.prototype.end() queued its callback with .push() on a private
array, which looks up Array.prototype.push at call time. Replacing that
method from user code made end() throw or drop the callback. Use an
indexed assignment instead.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/67751
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-26 16:03:37 +00:00
Tim Perry 7da2308afc quic: create streams synchronously
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67749
Reviewed-By: Efe Karasakal <hi@efe.dev>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-26 13:41:12 +00:00
Antoine du Hamel 4325ce0a57 2026-11-26, Version 27.0.0-alpha.0.2.0 (Alpha)
Notable changes:

doc:
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) https://github.com/nodejs/node/pull/67461
http2:
  * (SEMVER-MINOR) add writeProcessing to compat response (Yuya Inoue) https://github.com/nodejs/node/pull/67728
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) https://github.com/nodejs/node/pull/67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) https://github.com/nodejs/node/pull/67470
lib:
  * (SEMVER-MINOR) graduate the --process-timeout option (James M Snell) https://github.com/nodejs/node/pull/67506
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) https://github.com/nodejs/node/pull/58060
sqlite:
  * (SEMVER-MINOR) throw ERR_NO_SQLITE without SQLite support (Christian Aurich Zanettini Martins) https://github.com/nodejs/node/pull/67727
  * (SEMVER-MINOR) add statement.columnCount getter (Guilherme Araújo) https://github.com/nodejs/node/pull/67658
  * mark as stable (Christian Aurich Zanettini Martins) https://github.com/nodejs/node/pull/67654
src:
  * (SEMVER-MINOR) expand --process-timeout output to include workers (James M Snell) https://github.com/nodejs/node/pull/67712
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) https://github.com/nodejs/node/pull/66753
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) https://github.com/nodejs/node/pull/67532

PR-URL: https://github.com/nodejs/node/pull/67757
2026-11-26 09:43:02 +01:00
René fa49b1361b build: add synchronization.lib to crates build on Windows
Signed-off-by: René <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67590
Fixes: https://github.com/nodejs/node/issues/67589
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2026-11-26 02:33:07 +00:00
Beth Griggs f31711c6a7 tools,build: add CycloneDX SBOM generation
Add tools/sbom/generate_sbom.py, a stdlib-only Python 3 script that
writes a CycloneDX 1.7 SBOM describing the bundled dependencies of the
Node.js binary.

The script reads config.gypi to determine which dependencies are
active in the build, then extracts each one's version from whichever
file records it: C headers, CMakeLists.txt, package.json, Cargo.toml
and others. A version that cannot be read is reported as "unknown"
with a warning rather than failing the run. Dependencies satisfied by
a system library or disabled via a configure flag are omitted, so the
document lists only what ships in the build.

The root component records a pkg:generic/nodejs/node purl, the git
commit SHA as a hash on a VCS external reference, V8's embedder string
and the build machine's hostname. Its version, and the file name,
match process.version, including -pre, -alpha.* and `--tag=` suffixes.

A formulation section records the build environment: the C/C++
compiler, rustc, cargo and nasm versions that ./configure recorded in
config.gypi, their distro package versions on Linux, the host's glibc
version, and the ./configure command from config.status. Each probe is
independent, and anything undetermined is left out rather than failing
generation. The C and C++ compilers are named by product - gcc, clang
or apple-clang - since the version alone is ambiguous: Apple clang
17.0.0 is not upstream clang 17. configure.py now records those
products and versions, plus rustc and cargo, in config.gypi.

Output defaults to out/Release/node-v{version}-sbom.json, overridable
with SBOM_OUTPUT.

New Makefile targets:

  make sbom       - generate the SBOM (requires ./configure first)
  make test-sbom  - validate the generated SBOM

doc/contributing/maintaining/maintaining-dependencies.md now asks for a
DEP_CATALOG entry when adding a dependency, so new deps do not silently
go missing from the SBOM. tools/sbom/README.md covers the output and
how to generate it.

Unit tests in test/tools/test_generate_sbom.py cover catalog structural
correctness, the version extractors, scope resolution and deps/
coverage. They run under the existing `make tooltest` target.

Refs: https://github.com/nodejs/security-wg/issues/1115

Signed-off-by: Beth Griggs <bethanyngriggs@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66761
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
2026-11-25 21:19:04 +00:00
Nigro Simone 72bf3926bf node-api: find the Environment once
Without an async context, napi_make_callback went through the public
node::MakeCallback(), which looks up the Environment from the creation
context of the callback on every call. The napi_env already knows it,
so call into it directly, as the path with an async context does.
node_napi_env__::node_env() also looked it up from the context on every
call: find it once, a napi_env lives as long as its Environment.

Add a benchmark, napi/make_callback_napi.

Refs: https://github.com/nodejs/performance/issues/24
Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66509
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-25 20:16:27 +00:00
Roberto Bianchi 5a76601c8f events: use indexed appends in eventNames
Collect active event names with indexed writes instead of calling
the primordial push function for each name.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/66875
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-25 20:16:12 +00:00
Yaroslav Chuhai da97d87f9a esm: skip percent-decode copy for unescaped data URLs
stringPercentDecode() UTF-8 encodes its input into a fresh Uint8Array
and then percent-decodes it into a second array of the same size. After
URL parsing, a data: URL body contains '%' only when it has non-ASCII or
control characters or explicit escapes, so plain-text and base64 bodies
were copied byte-for-byte for nothing.

Return the encoded bytes directly when the input contains no '%'. UTF-8
never emits 0x25 inside a multi-byte sequence, so the result is
identical, and each call still returns its own buffer.

When there is a '%', pass its index to percentDecode(), which copies a
long unescaped prefix in bulk and decodes the rest through subarray
views, so the loop still starts at 0 and keeps its bounds checks
eliminated. The string index is used only when every code point encoded
to a single byte, so it is also the byte index.

Signed-off-by: Yaroslav Chuhai <yaroslavchuhai@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67684
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-25 20:15:56 +00:00
c08b6c39c5 src: migrate off ArrayBufferView::Buffer()
V8 16.0 removes `ArrayBufferView::Buffer()`. Use `GetBuffer()` instead,
which is already available in V8 15.8.

Refs: https://crrev.com/c/8794471
Co-Authored-By: Clemens Backes <post@clemens-backes.de>
Co-Authored-By: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67733
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-11-25 14:18:25 -05:00
James M Snell 0b41a91f58 lib: fix node --help missing env vars
The help text was dropping the `NODE_ICU_DATA`,
`NODE_OPTIONS`, `OPENSSL_CONF`, `SSL_CERT_DIR`,
and `SSL_CERT_FILE` env vars.

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Claude
PR-URL: https://github.com/nodejs/node/pull/67719
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-25 18:30:33 +00:00
Sergio Calderon 24d4db0564 test: converting for each to for..of
Signed-off-by: Sergio Calderon <sergioo.calderonn@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67126
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-11-25 18:10:19 +00:00
Adithya kumar Reddy Gopavaram 1106479d7e zlib: handle close before initialization
Fixes #67485

Signed-off-by: Adithya kumar Reddy Gopavaram <91198686+ADITHYAKUMARREDDY@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/67507
Fixes: https://github.com/nodejs/node/issues/67485
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-11-25 17:19:17 +00:00
Antoine du Hamel 122715e562 tools: pin remaining Cachix version on x86_64_darwin
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67743
Refs: https://github.com/nodejs/node/pull/67738
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-25 17:19:04 +00:00
Node.js GitHub Bot 3448133641 deps: update zstd to 1.6.0
PR-URL: https://github.com/nodejs/node/pull/67775
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-11-25 17:18:51 +00:00
Tim Perry 478c2eea87 tls: fix OpenSSL compression leak that breaks tests under ASAN
This is not impactful in any way - it's a fixed leak of the openssl
record compression descriptors, about 24 bytes leaked total, once
per process. Not meaningful.

It is annoying if you want to run with ASAN & leak detection though,
since it's an unambiguous leak we trigger every time crypto is used.

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66600
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-25 16:52:56 +00:00
Livia Medeiros 0623b0d4c7 lib: recognize <LS> and <PS> as line terminators
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67695
Refs: https://tc39.es/ecma262/#sec-line-terminators
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-25 14:49:11 +00:00
René Larch 2fd4580d4a src: rethrow linked binding initializer errors
GetLinkedBinding() reads module.exports after it calls the register
function of a linked binding. If the register function threw, that V8
API call clears the pending exception (PrepareForExecutionScope), so
the error never reaches the caller of process._linkedBinding(), which
gets the empty exports object instead. This affects every linked
binding, including Node-API ones, whose module registration already
rethrows the error of the initializer.

Addons loaded with process.dlopen() are not affected, because DLOpen()
does not call into V8 after the register function. Rethrow the error
before reading module.exports.

Signed-off-by: René Larch <renelarch@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67571
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-25 14:28:20 +00:00
Yuya Inoue bf201ef3e3 http2: add writeProcessing to compat response
The HTTP/1 ServerResponse has writeProcessing() to send a 102
Processing response, but Http2ServerResponse does not, so code moving
to the compat API fails with a TypeError when it calls it.

Add writeProcessing([callback]), which sends 102 through
writeInformation() like writeContinue() does.

Refs: https://github.com/nodejs/node/issues/29829
Refs: https://github.com/nodejs/node/pull/67705#issuecomment-7098482431
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Claude Code
PR-URL: https://github.com/nodejs/node/pull/67728
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-11-25 14:17:45 +00:00
Christian Aurich Zanettini Martins 18bb2e5e0e sqlite: throw ERR_NO_SQLITE without SQLite support
In builds configured --without-sqlite, passing --experimental-sqlite
exposes node:sqlite, and loading it then fails with
"No such binding: sqlite". Throw ERR_NO_SQLITE instead, like
node:crypto does without OpenSSL.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67727
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
2026-11-25 12:37:21 +00:00
Jiawen Geng ffc57f007f sqlite: guard re-entrant reset of a virtual table cursor
StatementIterator::Return() and SQLTagStore::ResetAndBindStatement()
called sqlite3_reset() without a SteppingStatementGuard. Resetting a
statement with an open virtual-table cursor runs the generator's
finally block, and that JavaScript can reset the same statement
again. SQLite then halts the VM a second time while the cursor slot
still points at the cursor, so xClose frees the same NodeVTabCursor
twice.

Hold the stepping guard across those resets so the re-entrant call
fails with "statement is already being executed" instead of closing
the cursor again. Ignore a second xClose on a cursor that is already
closing.

Assisted-by: Cursor Grok 4.7
Signed-off-by: gengjiawen <technicalcute@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67540
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-11-25 12:23:02 +00:00
Chengzhong Wu 1d069afb53 lib: skip source maps in node_modules by default
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67627
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-25 10:57:49 +01:00
Matteo CollinaandGuilherme Araújo 5440ac1f66 sqlite: enforce permission model in Database
Database opened database files without consulting the permission
model, so code running with --permission could read and write any
database regardless of --allow-fs-read and --allow-fs-write.

Check read access, and write access unless the database is read-only,
before opening a file-backed database. In-memory databases are exempt.
SQLite also opens journal, WAL and temporary files, and ATTACH and
backup() open further databases, so route every connection through a
VFS shim that checks each path SQLite opens, deletes or probes.

Reject URI filenames that select a VFS, since that would bypass the
shim, and deny ATTACH when SQLite does not pass the filename to the
authorizer.

Refs: https://hackerone.com/reports/3686625
Co-authored-by: Guilherme Araújo <arauujogui@gmail.com>
Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62957
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-25 06:43:21 +00:00
Matteo Collina 0230ad37a4 module: keep ESM load cache entries in fast mode
Keep per-URL load cache entries in fast-property mode while
   preserving their null prototype.

Assisted-by: Pi
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66276
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2026-11-25 06:43:06 +00:00
Matteo Collina 88c3dbedb6 stream: forward compose tail error after finish
compose() only listened for 'data' and 'end' on the last stream it was
given. When that stream emitted 'error' after its writable side had
already finished, pipeline() had already removed its own error listener,
so the error reached no listener and was raised as an unhandled 'error'
event, crashing the process.

Forward tail errors to the composed Duplex by destroying it whenever the
tail errors before the composition has been destroyed.

Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67674
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-25 05:59:14 +00:00