Commit Graph
47759 Commits
Author SHA1 Message Date
Trivikram Kamat e383a1da48 stream: use RangeError for broadcast overflow
Reject strict-backpressure writes with a RangeError when the broadcast
pending writes queue is full.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64420
Fixes: https://github.com/nodejs/node/issues/64419
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-24 02:44:32 +00:00
Trivikram Kamat 68dc116f34 stream: skip null output from stateful transforms
Treat null yielded by sync and async stateful transforms as no output,
consistent with transform normalization semantics.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64462
Fixes: https://github.com/nodejs/node/issues/64461
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 23:32:17 +00:00
Archkon de6eeece8f zlib: validate pledgedSrcSize as a safe integer
pledgedSrcSize represents an exact byte count. Reject values that are
not non-negative safe integers instead of silently ignoring or coercing
them through IntegerValue().

Apply the same validation to zlib/iter and retain a native validation
check for internal callers.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64604
Fixes: https://github.com/nodejs/node/issues/64603
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Jan Martin <jan.krems@gmail.com>
2026-07-23 22:17:50 +00:00
trivenay fe5037baa9 http: propagate highWaterMark to ClientRequest OutgoingMessage
`http.request({ highWaterMark })` passes the value to the TCP socket
via createConnection() but does not set it on the OutgoingMessage
internal kHighWaterMark.  OutgoingMessage._writeRaw() has two mutually
exclusive write paths:

  Path A (socket connected): conn.write() — uses socket HWM ✓
  Path B (no socket yet):    outputSize < this[kHighWaterMark] — uses
                             OutgoingMessage own default (64 KB) ✗

Because the OutgoingMessage constructor already accepts
options.highWaterMark, the fix is to set kHighWaterMark from the
user options after they are parsed in the ClientRequest constructor.

This resolves two symptoms:

  1. write() returning the wrong boolean for pre-socket writes (the
     user highWaterMark was silently ignored on all Node versions).

  2. A deadlock on Node >= 24.16.0 where the incorrect false return
     sets kNeedDrain, but drain never fires because the socket was
     never backpressured (introduced by the stricter drain gate in
     #62936).

Signed-off-by: Naman Trivedi <trivenay@amazon.com>
Fixes: https://github.com/nodejs/node/issues/64645
Refs: https://github.com/nodejs/node/pull/62936
PR-URL: https://github.com/nodejs/node/pull/64653
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-23 16:47:25 +00:00
Trivikram Kamat 241fb9a8f1 ffi: preserve strings during reentrant calls
Cache temporary string conversion buffers by wrapper and active call
depth. This prevents nested FFI calls from overwriting or replacing
buffers still in use by an outer native call.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/64551
Fixes: https://github.com/nodejs/node/issues/64550
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-07-23 15:27:21 +00:00
Antoine du Hamel 9f10b570f3 doc: clarify rules for adding new built-in modules
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64648
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-07-23 14:37:34 +00:00
Matteo Collina fd41198dff sqlite: fix use-after-free in Exec() and ApplyChangeset()
When sqlite3_exec() or sqlite3changeset_apply() call JavaScript
callbacks (user-defined functions, conflict handlers, or filter
callbacks), the DatabaseSync object could be garbage-collected
if the JavaScript code drops all references to it. Both methods
only held a raw DatabaseSync* pointer on the C++ stack, which
V8 GC does not track.

Add a BaseObjectPtr<DatabaseSync> guard that keeps the database
alive for the duration of these SQLite API calls, preventing a
use-after-free when the JavaScript callback triggers GC.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64535
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-07-23 14:37:21 +00:00
Tim Perry f9715fc595 quic: defer server session emit until TLS ClientHello is processed
This ensures we don't fire session events for totally invalid TLS
handshakes - fundamental errors, bad SNI/ALPN values, or anything else
that our TLS config would reject. Instead, it means servers can access
servername & alpnProtocol synchronously as soon as the event is fired -
all key session data is available and it's immediately usable.

We don't want to defer further to handshake completed, since that'd be
an extra RT, and defeat 0RTT benefits entirely. ClientHello processed
without errors is sufficient for now.

This isn't a security mechanism. Existing structures will defer
actually sending & receiving anything that's not marked explicitly as
early data until the handshake completes anyway.

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64132
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-23 13:44:46 +00:00
Rafael Gonzaga aedf2a4187 doc: mention DEPENDENCY custom field for H1 reports
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/64634
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-23 12:27:40 +00:00
James M Snell 3437febacd test: update quic tests for stream/iter update
PR-URL: https://github.com/nodejs/node/pull/64464
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 05:19:46 -07:00
James M Snell 64c115072e stream, quic: update iterable streams backpressure
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus
PR-URL: https://github.com/nodejs/node/pull/64464
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 05:19:45 -07:00
James M Snell b9ed467618 stream: update iterable streams to use budget backpressure
Updates the implementation to use the updated backpressure
model that landed here: https://github.com/WinterTC55/iter-streams/pull/23

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus
PR-URL: https://github.com/nodejs/node/pull/64464
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 05:19:44 -07:00
Tim Perry 82c823eefc test: fix flaky http2 socket proxy test
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64673
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-23 10:22:10 +00:00
Shivam S a609b172bd doc: fix dnsPromises.lookup verbatim default
The verbatim default flipped to true in v17 (#39987), but the
dnsPromises.lookup docs still say false. The order bullet right above
it and the dns.lookup section both already say the addresses are not
reordered by default, so this bullet was contradicting them.

Signed-off-by: BIGSUS24 <152616194+BIGSUS24@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64658
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-07-23 08:35:34 +00:00
Trivikram Kamat 0992f6b87e ffi: preserve uint8 semantics for bool fast calls
Normalize bool to kUint8 when creating Fast API metadata. This keeps
optimized calls consistent with generic FFI behavior, including numeric
return values and rejection of JavaScript Boolean values.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/64527
Fixes: https://github.com/nodejs/node/issues/64526
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-07-23 03:33:17 +00:00
dependabot[bot] b57e7d03fc tools: bump brace-expansion from 5.0.6 to 5.0.7 in /tools/eslint
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 5.0.6 to 5.0.7.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v5.0.6...v5.0.7)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 5.0.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/64636
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-23 02:16:26 +00:00
Antoine du Hamel 2deb0a1b0f doc: fix broken links and clean up type map
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64625
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-22 13:18:57 +00:00
Jihwan e6e6f677b3 doc: fix typo in releases guide
Signed-off-by: hanityx <hanityx@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64621
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-07-22 10:34:56 +00:00
Antoine du Hamel 15d5b8f7fe stream: remove custom CloneableDOMException implementation
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64469
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-07-22 10:34:47 +00:00
Antoine du Hamel efc0a14461 dns: stop using deprecated functions in SetServers
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64356
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-07-22 08:44:48 +00:00
Mike McCready 3a2be846a0 doc: add MikeMcC399 as collaborator
Signed-off-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64656
Fixes: https://github.com/nodejs/node/issues/64502
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-07-22 10:03:20 +02:00
Trivikram Kamat fbab458611 ffi: validate fast integer argument ranges
Validate narrow integer and 64-bit BigInt arguments before entering
the Fast API trampoline. This prevents out-of-range values from being
silently truncated or wrapped and matches the generic FFI path.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/64614
Fixes: https://github.com/nodejs/node/issues/64613
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-07-22 06:49:15 +00:00
Stephen Belanger 594d0c562c diagnostics_channel: grow native channel storage
Every string-named JavaScript channel consumed an entry in the fixed
native subscriber array. Creating more than 1,024 channels triggered a
CHECK and terminated the process.

Allocate slots only for native publishers and grow the aliased buffer
when it fills. Refresh the JavaScript view after resizing and preserve
the capacity in snapshots.

Signed-off-by: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: https://github.com/nodejs/node/pull/64497
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-22 03:40:02 +00:00
Filip Skokan db3a8d866a src: avoid redundant KEM encapsulation copies
KEM encapsulation produces separate ciphertext and shared-secret
allocations. The existing DeriveBitsJob path packs both values into an
intermediate buffer, then copies them again into separate buffers.

Instead, this uses a dedicated KEMEncapsulateJob to retain both outputs
across the worker boundary and convert each directly through ByteSource.
This removes the intermediate allocation and at least one complete round
of copies.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64553
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-21 15:46:39 +00:00
Filip Skokan 0b7aa61175 src: avoid redundant DataPointer reallocations
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64552
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-21 15:46:27 +00:00
Filip Skokan 0938489558 crypto: preserve RSA-PSS legacy pubkey DER
Recreate the historical rsaEncryption AlgorithmIdentifier used by
X509Certificate legacy pubkey output for restricted and unrestricted
RSA-PSS keys without relying on deprecated RSA APIs.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64547
Refs: https://github.com/nodejs/node/pull/64211
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-21 15:46:12 +00:00
Filip Skokan 81145bf60b crypto: cleanse provider private key copies
Clear provider-exported RSA, EC, and DH private BIGNUMs before freeing
them. Also cleanse OSSL_PARAM builder copies and the plaintext DER
intermediate used for encrypted traditional PEM output.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64547
Refs: https://github.com/nodejs/node/pull/64211
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-21 15:46:11 +00:00
Filip Skokan 3cfb063bd4 crypto: handle incomplete RSA private keys
Treat missing private RSA parameters as an export failure instead of
passing null BIGNUM pointers to the JWK encoder. Also stop constructing
a usable RSA view when reading an optional parameter itself fails.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64547
Refs: https://github.com/nodejs/node/pull/64211
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-21 15:46:10 +00:00
Filip Skokan ad1a0f356b crypto: retain legacy DH validation
Limit the g >= p rejection needed by the provider backend to OpenSSL 3.
Preserve the legacy DiffieHellman object and expose the validation
result through verifyError as before.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64547
Refs: https://github.com/nodejs/node/pull/64211
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-07-21 15:46:08 +00:00
Ryuhei Shima cecfdceed3 zlib: accept ArrayBuffer dictionary in Zstd
Fixes: https://github.com/nodejs/node/issues/64598
Signed-off-by: islandryu <shimaryuhei@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64599
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-21 15:03:54 +00:00
Md Muhtasim Munif Fahim 8cf16b31f6 doc: use promote wording in release guide
Signed-off-by: Muhtasim-Munif-Fahim <s1911024120@ru.ac.bd>
PR-URL: https://github.com/nodejs/node/pull/64371
Fixes: https://github.com/nodejs/node/issues/64360
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-07-21 10:15:37 +00:00
Muhammad Zeeshan 4efa0c6311 doc: fix import.meta example for vm.SourceTextModule
The import.meta example for new vm.SourceTextModule() in vm.md does not
run as written. It fails in two separate ways.

First, the constructor is missing the context: contextifiedObject
option, so the module evaluates in the top context where secret is not
defined, and the snippet throws ReferenceError: secret is not defined.

Second, the trailing note suggests replacing meta.prop = {} with
vm.runInContext('{}', contextifiedObject), but '{}' is parsed as an
empty block and evaluates to undefined. That makes the following
Object.getPrototypeOf(import.meta.prop) throw TypeError. Wrapping it as
'({})' returns an object, which is what the note intends.

This adds the context option and corrects the suggested replacement to
'({})' in both the mjs and cjs variants.

Fixes: https://github.com/nodejs/node/issues/64076
Signed-off-by: Muhammad Zeeshan <61280174+zeeshan56656@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64112
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-07-21 07:33:45 +00:00
Steven f3ecafac44 doc: mention crypto.hash() for better perf
Signed-off-by: Steven <steven@ceriously.com>
PR-URL: https://github.com/nodejs/node/pull/63420
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-07-21 07:33:36 +00:00
Node.js GitHub Bot c76aff4e0a tools: update nixpkgs-unstable to 20535e48e12c86043b577b8518234ff5dbb
PR-URL: https://github.com/nodejs/node/pull/64589
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-21 06:37:50 +00:00
AkshatOP 4bec1915dc vfs: make recursive readdir iterative
MemoryProvider recursive readdir walked the directory tree with a
recursive helper. Rewrite it to traverse iteratively with an explicit
stack so a deeply nested tree can no longer exhaust the call stack.

The set of directories on the active traversal path is still tracked, so
a circular symlink stops descending while its entry remains listed; the
output and observable behavior are unchanged.

Refs: https://github.com/nodejs/node/pull/64168
Signed-off-by: AkshatOP <hunterdevil0987@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64149
Fixes: https://github.com/nodejs/node/issues/64148
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-07-21 06:37:41 +00:00
Maxence Robinet 0bf185c566 doc: update sea example by fixing wrong code example
The SEA configuration defines the output binary as `sea`, but the
signing and run steps still referenced `hello`. Update the example
to use `sea` consistently so the commands match the generated
binary.

Signed-off-by: Maxence Robinet <107369283+saint-james-fr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64025
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-07-21 06:37:30 +00:00
Archkon 8c1d1284cd zlib: reject truncated zstd input
Treat an unfinished Zstd frame as an unexpected end of file when the
stream is finalized with ZSTD_e_end.

Avoid reporting an error while the output buffer still needs to be
drained or when an empty final write follows a completed frame. Preserve
partial decompression when ZSTD_e_flush is used.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64593
Fixes: https://github.com/nodejs/node/issues/64592
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
2026-07-21 05:41:42 +00:00
Adrián Estrada 51c09eae6c src,permission: do not throw on denied access in audit mode
The THROW_IF_INSUFFICIENT_PERMISSIONS and
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS macros called
ThrowAccessDenied/AsyncThrowAccessDenied unconditionally and only
guarded the `return` with `warning_only()`.
ERR_ACCESS_DENIED_IF_INSUFFICIENT_PERMISSIONS had no `warning_only()`
guard at all — it always set the access-denied error and returned.
As a result, running with `--permission-audit` still produced
ERR_ACCESS_DENIED on any denied operation (fs, net, child_process,
worker, addon, ffi, inspector, wasi), defeating the audit-only purpose
of the flag.

Guard the denied-error path behind `!warning_only()` in all three
macros. In audit mode, the diagnostics-channel message is published
(already done in Permission::is_scope_granted) and execution continues;
in enforce mode (`--permission`), behavior is unchanged — the error is
raised and the call returns.

The tests cover both the direct (top-level) call and an `eval()`-wrapped
call: the direct call exercises the normal script path, and the
`eval()`-wrapped call exercises the V8 script-context boundary (the
diagnostics subscriber is registered in the outer module context while
the denied operation runs inside an eval'd string).

Refs: https://github.com/nodejs/node/commit/9ddd1a9c27c253f46d587a8c906ccd83417b4606
Signed-off-by: Adrian Estrada <edsadr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64426
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-07-21 05:41:30 +00:00
Chengzhong Wu 69e982f70d build: merge multiple on download artifact
When there are multiple artifacts, `actions/download-artifact` creates
subdirectories for each artifact, and results in incorrect folder
structure assumptions in later steps.

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/64633
Fixes: https://github.com/nodejs/node/issues/64554
Refs: https://github.com/actions/download-artifact#download-all-artifacts
Refs: https://github.com/nodejs/node/actions/runs/29768247349/job/88454933457?pr=64565#step:2:24
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-07-21 01:22:16 +00:00
Node.js GitHub Bot 607190701a deps: update timezone to 2026c
PR-URL: https://github.com/nodejs/node/pull/64588
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-21 01:21:50 +00:00
Trivikram Kamat 4991131590 stream: fix drop-newest behavior in share()
Discard upstream pull results when the shared buffer has reached its
highWaterMark instead of allowing the buffer to grow beyond its limit.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64417
Fixes: https://github.com/nodejs/node/issues/64416
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-21 00:52:34 +00:00
YuSheng Chen 1b42f7600e doc: fix socket.readyState state descriptions
Signed-off-by: yusheng <samuel871211@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64468
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-20 21:51:40 +00:00
Filip Skokan 5b27fb976f doc: replace large tables in crypto.md and webcrypto.md with lists
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64582
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-20 18:25:05 +00:00
Aviv Keller fe3b3b8b72 meta: lower stale to 3 months
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64569
Refs: https://github.com/nodejs/node/pull/62105/changes#r3182288004
Refs: https://openjs-foundation.slack.com/archives/C019Y2T6STH/p1784126065845719
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-20 06:34:17 +00:00
Trivikram Kamat 00917ba54c ffi: evaluate function signatures once
Function signatures were read by the native implementation and then
read again while creating JavaScript wrappers. Accessors, proxies,
or mutations could therefore produce different native and JavaScript
signatures.

Build wrappers from signature metadata captured by native code instead.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/64559
Fixes: https://github.com/nodejs/node/issues/64558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-07-20 05:24:57 +00:00
Paul Bouchon c286592321 doc: note --env-file is not applied to --run
Environment variables loaded with `--env-file` are not applied to the
command executed by `--run`. Document this limitation under `--run`.

Fixes: https://github.com/nodejs/node/issues/62988
Signed-off-by: Paul Bouchon <mail@bitpshr.net>
PR-URL: https://github.com/nodejs/node/pull/64442
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-07-19 21:06:20 +00:00
Adrián Estrada 0bcc6ef01e cli: style node --help output with util.styleText
Apply util.styleText to the `node --help` output for improved visual
hierarchy and scannability. Styling is applied only when the output
stream supports color (detected via util.styleText's built-in
shouldColorize), so piped/redirected output and NO_COLOR remain plain
text with no behavior change.

- Bold: Usage lines, Options:, Environment variables: headers
- Bold green: CLI option names (e.g. --inspect, -e, --eval)
- Bold magenta: environment variable names (e.g. NODE_PATH)
- Dim: "(currently set)" annotation
- Blue underline: documentation URL

Column-width math uses unstyled string lengths to preserve alignment
regardless of styling. The "(currently set)" annotation is styled via
post-processing after layout to avoid breaking the fold() width
calculation.

Signed-off-by: Adrian Estrada <edsadr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64484
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-07-19 20:38:29 +00:00
Matteo Collina d25cde436d timers: do not retain a reference to the async store after firing
After firing timers, we can clean them up by iterating over all active
stores and setting the relevant symbols to undefined.

Fixes #53408

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/53443
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2026-07-19 18:30:06 +00:00
Filip Skokan d90d9d55ad crypto: limit KangarooTwelveParams customization to 512 bytes
To align with a future OpenSSL-imposed limit.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64557
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-19 15:58:25 +00:00
avivkeller 4f844f4380 repl: use inspector over vm
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64034
Fixes: https://github.com/nodejs/node/issues/64523
Closes: https://github.com/nodejs/node/pull/64534
Fixes: https://github.com/nodejs/node/issues/39387
Closes: https://github.com/nodejs/node/pull/39392
Fixes: https://github.com/nodejs/node/issues/61390
Fixes: https://github.com/nodejs/node/issues/63126
Fixes: https://github.com/nodejs/node/issues/38503
Fixes: https://github.com/nodejs/node/issues/37445
Fixes: https://github.com/nodejs/node/issues/38145
Fixes: https://github.com/nodejs/node/issues/33369
Fixes: https://github.com/nodejs/node/issues/48131
Fixes: https://github.com/nodejs/node/issues/8309
Fixes: https://github.com/nodejs/node/issues/39689
Fixes: https://github.com/nodejs/node/issues/18931
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-07-18 12:59:37 -07:00