Commit Graph
49218 Commits
Author SHA1 Message Date
Rafael Gonzaga b9e4abf4e5 doc: list openssl-store channel and drop field in permissions
The node:permission-model:openssl-store diagnostics channel and the
--allow-openssl-store flag were introduced in
https://github.com/nodejs/node/pull/63949, but the Audit Mode section
of the permissions documentation was not updated to list them.

Refs: https://github.com/nodejs/node/pull/63949
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66558
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-21 15:16:25 +01:00
Barath Raj 395b870f83 http2: do not reset stream before END_STREAM is sent
When a compat API response finishes and the request had no body,
kMaybeDestroy() takes the graceful-close path and sends
RST_STREAM(NO_ERROR) right away. If the connection flow-control
window is exhausted at that point, the empty END_STREAM DATA frame
is still queued, so the reset goes out first and the END_STREAM
frame is dropped, truncating an otherwise complete response.

Skip the graceful close when the request already ended with its
HEADERS frame, since there is no request body to abort.

Fixes: https://github.com/nodejs/node/issues/66525
Refs: https://github.com/nodejs/node/pull/64265
Refs: https://github.com/nodejs/node/pull/64663
Signed-off-by: Barath <barathraj048@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66672
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Efe Karasakal <hi@efe.dev>
2026-11-21 15:16:24 +01:00
Austin BurdineandAntoine du Hamel c55fbe5af6 deps: V8: backport 2444c109f4f8
Original commit message:

    [heap] Treat zero allocation throughput as a low allocation rate

    Since https://crrev.com/c/5935313 allocation throughput is tracked with
    SmoothedBytesAndDuration, which has no lower bound. A sampled throughput
    of exactly 0 -- nothing was allocated, or the smoothed value decayed to
    0 after a long idle period -- made ComputeMutatorUtilizationImpl()
    return a mutator utilization of 0 ("maximal allocation"). For an isolate
    that never allocates on the CppHeap, HasLowAllocationRate() is then
    never true and the MemoryReducer cannot start a GC through its
    low-allocation condition; only the 100s watchdog can. Node.js hits this
    for any process that does not use node:vm.

    Remove the special case. A mutator speed of 0 now yields a mutator
    utilization of 1, i.e. the lowest possible allocation rate. gc_speed is
    either the conservative default or at least 1 byte/ms, so the formula
    stays well defined.

    Bug: 570738027
    Change-Id: I84cd51607df3c31c2f1e02bb2fe258e5506131ce
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8521518
    Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
    Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
    Reviewed-by: Omer Katz <omerkatz@chromium.org>
    Commit-Queue: Omer Katz <omerkatz@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#110599}

Refs: https://github.com/v8/v8/commit/2444c109f4f8165024971e15b12eb4611b4cd676
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66736
2026-11-21 15:16:24 +01:00
LuYahan 1137e8a544 deps: V8: backport 8521e2e77535
Original commit message:

    [riscv]Fix unordered FP comparison and emit at the consumer

    The lowering for kFloatLessThanOrUnordered and
    kFloatLessThanOrEqualOrUnordered incorrectly mapped to (LT, true)
    and (LE, true), respectively. Since ComputeBranchInfo can negate a
    branch condition after emitting the comparison, complementary
    conditions must use the same comparison and invert its predicate.
    The incorrect mappings dropped the negation, breaking NaN semantics.
    For example, optimized Wasm loops like
    `do { x += 1.0; } while (!(x > 0.0));` produced wrong results.

    Fix the mappings: kFloatLessThanOrUnordered now uses negated GE,
    and kFloatLessThanOrEqualOrUnordered uses negated GT. To prevent
    this class of bug, also convert kRiscvCmpS and kRiscvCmpD into
    pseudo-instructions like the integer kRiscvCmp. The actual
    comparison is now emitted at the single flags consumer (branch,
    boolean materialization, or select) through the new EmitFPCompare
    helper, using the consumer's final FlagsCondition. This ensures
    the predicate and machine condition are resolved consistently.
    Generated code remains byte-identical.

    Bug: 557938134
    Change-Id: I230e181753c5e9c6e7fbea651e551192a76e4005
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8360836
    Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
    Auto-Submit: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
    Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
    Cr-Commit-Position: refs/heads/main@{#109690}

Refs: https://github.com/v8/v8/commit/8521e2e77535a5c255d15ff8deb459fc7260c54d
Co-authored-by: LuYahan <yahan@iscas.ac.cn>
PR-URL: https://github.com/nodejs/node/pull/65898
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:24 +01:00
Jakob LinkeandRadu Samson 748cfdc9f5 deps: V8: backport 1e7ee91de775
Original commit message:

    [regexp] Reset flags between negative lookaround branches

    e540e1161b0 (bug 510487690) reset the analysis-time flags between the
    alternatives of a ChoiceNode, since an alternative's sub-graph may
    contain a MODIFY_FLAGS node. NegativeLookaroundChoiceNode has its own
    visitor and was left out, so a modifier group inside a negative
    lookaround still leaks its flags into the continuation.

      /(?!(?i:x|y))[K]/.exec('kz') // "k", should be null

    The lookaround body is visited first and leaves the group's flags
    behind; the continuation's class ranges are then made case independent
    under those flags rather than the pattern's, so [K] picks up 'k'.

    Only class ranges are affected: TextNode::MakeCaseIndependent
    materializes the equivalents during analysis, while atoms get their case
    closure at emission time from the restored flags. A single- alternative
    body does not reproduce either, since its restore node is emitted last.

    Change-Id: I4077076b9dbee6acf75918a2c4f7bf7d86cab059
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8175612
    Auto-Submit: Jakob Linke <jgruber@chromium.org>
    Reviewed-by: Patrick Thier <pthier@chromium.org>
    Commit-Queue: Patrick Thier <pthier@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#109043}

Refs: https://github.com/v8/v8/commit/1e7ee91de77500f9905ebbc5bed33c2186b1e871
Co-authored-by: Radu Samson <radu.samson@ext.ec.europa.eu>
Refs: https://github.com/nodejs/node/issues/66277
PR-URL: https://github.com/nodejs/node/pull/67207
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:24 +01:00
pthier e37da67f49 deps: V8: backport d315af3d83cf
Original commit message:

    [regexp] Reset compiler flags between word boundary branches

    When compiling \b and \B word boundary checks in AssertionNode where the
    succeeding character type is unknown, two code paths (before_non_word and
    before_word) are generated sequentially.

    If the boundary assertion is placed inside a modifier group (e.g.
    (?i:\.|\bNULL)), emitting the first branch traverses through on_success
    and reaches the ActionNode that restores outer flags at group exit.
    This mutates flags without restoring it when returning to emit the
    second branch. Consequently, subsequent nodes in the second branch
    (before_word) were incorrectly compiled with outer flags instead
    of the modifier group's flags.

    This CL saves compiler->flags() and restores them before emitting the
    before_word branch in AssertionNode::EmitBoundaryCheck.

    TAG=agy

    Fixed: 544575761
    Change-Id: I7f08bcb99c749d5e22636c8bd6eb44bd1d3e2e39
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8257209
    Reviewed-by: Victor Gomes <victorgomes@chromium.org>
    Commit-Queue: Patrick Thier <pthier@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#109236}

Refs: https://github.com/v8/v8/commit/d315af3d83cfe3bc1709f5b140db393db42790b3
Refs: https://github.com/nodejs/node/issues/66277
PR-URL: https://github.com/nodejs/node/pull/67207
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:24 +01:00
Jakob LinkeandRadu Samson 3c0d8636c3 deps: V8: backport b69a1a1d8613
Original commit message:

    [regexp] Record flags on deferred worklist items

    ActionNode::Emit for MODIFY_FLAGS was previously changed to restore
    outer_flags on the way out to avoid leaking inner flags to trailing
    deferred nodes. However, this caused nodes deferred from within the
    modifier group to be compiled with the outer flags when processed by
    Compiler::Assemble.

    Instead of restoring flags in ActionNode::Emit, record the active flags
    at the point where a node is deferred in Compiler::AddWork, and restore
    them from the work-list item before emitting it.

    This partially reverts
    https://chromium-review.googlesource.com/c/v8/v8/+/8174589.

    Change-Id: I3a552f9223b88ba99889e4375b8d1ea761257b94
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8213283
    Reviewed-by: Patrick Thier <pthier@chromium.org>
    Auto-Submit: Jakob Linke <jgruber@chromium.org>
    Commit-Queue: Patrick Thier <pthier@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#109102}

Refs: https://github.com/v8/v8/commit/b69a1a1d8613472f7a3f174060356687ba4255fa
Co-authored-by: Radu Samson <radu.samson@ext.ec.europa.eu>
Refs: https://github.com/nodejs/node/issues/66277
PR-URL: https://github.com/nodejs/node/pull/67207
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:24 +01:00
pthier 1bb15f6cef deps: V8: cherry-pick 19e7a57bce3e
Original commit message:

    [regexp] Reset flags after resetting state in Parser

    When restoring the previous state after parsing a closing parenthesis
    we also need to restore flags explicitly from the restored state.

    Fixed: 523687962
    Change-Id: I63a5bd9fec2f9b7f6fb43b6893027c3c3d0755f0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7950157
    Auto-Submit: Patrick Thier <pthier@chromium.org>
    Commit-Queue: Jakob Linke <jgruber@chromium.org>
    Reviewed-by: Jakob Linke <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#108021}

Refs: https://github.com/v8/v8/commit/19e7a57bce3eaae13cfc4f9ddfaaaa2c0fcca78e
Refs: https://github.com/nodejs/node/issues/66277
PR-URL: https://github.com/nodejs/node/pull/67207
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:24 +01:00
pthier 1b18d776ac deps: V8: backport e540e1161b02
Original commit message:

    [regexp] Fix modifiers for ChoiceNodes during Analysis

    During the analysis pass we didn't reset flags after visiting
    alternatives of a ChoiceNode, which is required as the sub-graph of an
    alternative might modify the flags.

    Fixed: 510487690
    Change-Id: I6b2660a98b34cd12740538af4ce61685609934a0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7826630
    Commit-Queue: Patrick Thier <pthier@chromium.org>
    Auto-Submit: Patrick Thier <pthier@chromium.org>
    Reviewed-by: Jakob Linke <jgruber@chromium.org>
    Commit-Queue: Jakob Linke <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#107120}

Refs: https://github.com/v8/v8/commit/e540e1161b0217ada6d59c8bc5a3a42fd3e27f40
Refs: https://github.com/nodejs/node/issues/66277
PR-URL: https://github.com/nodejs/node/pull/67207
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:24 +01:00
Milad Fa 33e69431ea deps: V8: cherry-pick f331137d5968
Original commit message:

    PPC: Fix safepoint record

    This patch is needed after http://crrev.com/c/7899697 started failing
    this test intermittently during GC on pntr compressed debug builds:
    ```
    === mjsunit/compiler/regress-crbug-1464516 ===
    --- stderr ---
    #
    # Fatal error in ../../src/objects/tagged-impl.h, line 138
    # Debug check failed: kCanBeWeak || (!IsSmi() == HAS_STRONG_HEAP_OBJECT_TAG(ptr_)).
    ```

    PPC could emit a trampoline pool right after `MacroAssembler::Call`
    returns which could make any subsequent `DefineSafepoint` calls
    record the incorrect `pc_offset` as it then points to after the emitted pool.

    This CL patches every "MacroAssembler::Call" site to record the pc_offset before the trampoline pool is emitted similar to how it's
    done on riscv.

    It's essentially porting the following changes to PPC:
    f385232a87a46af77c97e9095c8a25e559c37ce7
    2c6618f2d927a91dd54727abf096828521f7439f

    Change-Id: I2095bce8b69b0c4f064117ed95ee2f3245436e62
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7918866
    Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
    Reviewed-by: John <junyan1@ibm.com>
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Cr-Commit-Position: refs/heads/main@{#107921}

Refs: https://github.com/v8/v8/commit/f331137d5968b4665485eb20de618093a8b17d82
PR-URL: https://github.com/nodejs/node/pull/67261
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-21 15:16:24 +01:00
Olivier Flückiger 96e056676b deps: V8: cherry-pick c21a93ec80d5
Original commit message:

    [sandbox] Fix JSDispatchTable entry mark-bit erasure

    A race condition exists in V8's concurrent marking and deoptimization
    logic where Code::SetMarkedForDeoptimization updates a dispatch table
    entry without running a write barrier. During concurrent marking, a
    background thread's CAS mark can be overwritten by the mutator's blind
    store, leading to a live entry being swept.

    Fixed: 525686865
    Change-Id: I0cebd44b62ad5c16c19d73e5586058b1d2265ee4
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8074259
    Commit-Queue: Olivier Flückiger <olivf@chromium.org>
    Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
    Auto-Submit: Olivier Flückiger <olivf@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#108583}

Refs: https://github.com/v8/v8/commit/c21a93ec80d526fd270b119a2e8b7e26623d1b3b
PR-URL: https://github.com/nodejs/node/pull/66729
Fixes: https://github.com/nodejs/node/issues/66661
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:23 +01:00
Dominik Inführ 8a9c7ccbe3 deps: V8: cherry-pick 497c2e6a2434
Original commit message:

    [heap] Always decrement age in RetainMaps()

    When the prototype and constructor were already marked we did not
    age the map because of the assumption that this would only keep the
    transition tree alive. However, this does not hold because of
    the JSFunctions inside an AccessorPair in DescriptorArray.

    This can result in retaining maps indefinitely when not triggering
    memory reducing GCs. This CL therefore simplifies the code to
    always age maps instead. This is neutral on Speedometer and Jetstream.

    Bug: 571157135
    Change-Id: I8fb633a0ec0c1d66e4596390ca48e1c7006c9cc2
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8557820
    Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#110622}

Refs: https://github.com/v8/v8/commit/497c2e6a2434af02b44417b55b1576702922f5e9
PR-URL: https://github.com/nodejs/node/pull/66728
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:23 +01:00
npm CLI robot 44905d6700 deps: upgrade npm to 11.21.2
PR-URL: https://github.com/nodejs/node/pull/67264
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-21 15:16:23 +01:00
Filip Skokan 63a72c4548 crypto: remove the FIPS provider name check
FIPS-capable providers can use names other than fips. Remove the
named-provider lookup and explicit self-test from the startup flags,
leaving algorithm availability checks to each operation.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67358
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:23 +01:00
Brad Anderson 2987e12154 crypto: fix ncrypto provider behavior
Honor requested primality check counts with provider-backed OpenSSL.

Support empty passphrases for encrypted SEC1 PEM output.

Assisted-by: Codex
Signed-off-by: Brad Anderson <brad@sankatygroup.com>
PR-URL: https://github.com/nodejs/node/pull/67039
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:23 +01:00
Matteo Collina 6dbf32742c crypto: prevent stale OpenSSL errors
Clear errors raised by key comparison, SPKAC parsing, and JWK
import. Ensure TLS and private-key parsing only inspect errors
from their own OpenSSL calls.

Assisted-by: Codex
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67225
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:23 +01:00
Yagiz Nizipli 15cae397d8 crypto: reuse HMAC contexts in createHmac()
Every HMAC context was created with EVP_MAC_fetch() and keyed with the
digest passed by name, so the provider fetched the digest again on
each init. Both lookups go through OpenSSL's method store.

Keep an HMAC context without a key for each digest in the
per-Environment digest cache, and duplicate it in createHmac(). A
duplicated context already has its digest, so keying it with the same
digest no longer fetches anything.

Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
Assisted-by: Grok
PR-URL: https://github.com/nodejs/node/pull/67109
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:23 +01:00
Yagiz Nizipli c5cc25fc38 crypto: cache digests for synchronous operations
createHmac(), createSign(), createVerify() and the synchronous
one-shot sign, verify, HKDF and PBKDF2 functions looked up their
digest with Digest::FromName(). That returns OpenSSL's legacy EVP_MD,
so every EVP_DigestInit_ex() and HMAC init had to fetch the provider
implementation again through the method store.

Look these digests up through the per-Environment cache that
createHash() and crypto.hash() already use. Jobs on the thread pool
keep using Digest::FromName(): with the cache, Web Crypto digest and
HMAC throughput went down, because workers that finish sooner have to
be woken up for each new job more often.

Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
Assisted-by: Grok
PR-URL: https://github.com/nodejs/node/pull/67109
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:23 +01:00
Filip Skokan 9a3f498d06 crypto: skip DH checks for recognized groups
Explicit DH parameters are recognized as named groups during OpenSSL
provider import, but DHPointer::check() only skips primality checks for
groups constructed by name. This makes createDiffieHellman() block for
seconds on standard MODP groups.

Query the imported key's group name to restore the legacy DH_check()
shortcut without changing key generation. Add a deterministic regression
test with randomness disabled and cover explicit and padded parameters
through the JavaScript API.

Fixes: https://github.com/nodejs/node/issues/67067
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67071
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 15:16:22 +01:00
Filip Skokan 92f61d001f crypto: add X509Certificate inspection getters
Expose version, subjectName, issuerName, extensions, tbs, and signature
without requiring callers to parse display strings or certificate DER.

Names include complete DER and grouped, ordered RDN attributes.
Extensions retain their order, duplicate and unknown OIDs, criticality,
and raw values. Expose the exact signed TBSCertificate bytes and the
signature octets, algorithm OID, and DER parameters.

Return fresh objects, arrays, and Buffers from the new getters, leaving
existing getter caching unchanged. Report inspection failures as
ERR_CRYPTO_INVALID_X509_CERTIFICATE.

Fixes: https://github.com/nodejs/node/issues/48730
Assisted-by: Codex
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67082
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-13 09:02:23 +01:00
Filip Skokan e76a35c134 crypto: preserve errors during X.509 issuer checks
X509View::isIssuedBy() clears the caller's OpenSSL error queue on
entry and exit, including when either certificate is missing.

Use a mark/pop scope to discard errors from the issuer check without
losing earlier diagnostics. Cover successful checks, mismatches,
malformed extensions, and null inputs with empty and populated queues.

Assisted-by: Codex
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66898
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-13 09:02:23 +01:00
Filip Skokan ecbd6f7879 tls,tools: update BoringSSL pin and TLS errors
Use BoringSSL 0.20261020.0 for shared-library builds and expose the
package wrapper's version to the matrix updater.

The new verifier no longer emits UNABLE_TO_VERIFY_LEAF_SIGNATURE
after Node's verification callback accepts a missing-issuer error.
Expect UNABLE_TO_GET_ISSUER_CERT_LOCALLY for the affected leaf
certificates and suggest --use-system-ca for that error.

Drop the SSL_get_server_tmp_key() fallback now that BoringSSL supplies
SSL_get_peer_tmp_key() as a compatibility stub.

Refs: https://boringssl-review.googlesource.com/c/boringssl/+/103849
Refs: https://github.com/electron/electron/pull/55110/changes/b457e70e339e8bb3066b210edfb6f96582cdb374
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66922
Backport-PR-URL: https://github.com/nodejs/node/pull/67442
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-13 09:02:23 +01:00
Philipp Dunkel 422149fd7b vfs: do not reuse the path of a loaded memfd image
On Linux an addon or FFI library inside a VFS is loaded from an
anonymous memfd through /proc/self/fd/N, and the memfd was closed
right after a successful load. The next image then got the same fd
number, hence the same path, and the dynamic loader, which knows a
loaded object by the path it was opened with, returned the object
already loaded under that path instead of loading the new file. So
the second of any two addons or libraries loaded from a VFS resolved
to the first: an addon after an FFI library failed with "Module did
not self-register", an FFI library after an addon had none of its
own symbols, and two addons silently became the same one.

The fd is only needed until dlopen() returns, as the load's mapping
keeps the memory alive from then on; what must not be shared is the
path. Before the load, ask the loader with RTLD_NOLOAD whether the
path is already taken, and if so move the fd to a higher number with
F_DUPFD_CLOEXEC until it is free. Holding the fd from the check
through the load keeps anyone else from taking the path in between,
so this needs neither a counter nor a lock, and a library that has
really been unloaded gives its number back. The fd is closed right
after the load, whether or not it worked. Should no free number be
left, the image goes to a temp file.

The leak checks of test-vfs-addon and test-ffi-vfs compared the shared
temporary directory before and after the load, so off Linux any other
test loading from bytes at the same time could pass for a leak. Point
TMPDIR at a directory each test owns instead.

Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: https://github.com/nodejs/node/pull/67068
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-13 09:02:22 +01:00
Node.js GitHub Bot 16fd46d775 deps: update nghttp2 to 1.71.0
PR-URL: https://github.com/nodejs/node/pull/67331
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-12 18:00:43 +01:00
nashit hayat b8bfb2a05b inspector: fix out-of-bounds read in ws frame decoding
Signed-off-by: nashit hayyat <nashit@bugqore.com>
PR-URL: https://github.com/nodejs/node/pull/64618
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
2026-11-12 18:00:43 +01:00
Node.js GitHub Bot c9221de87d deps: update ngtcp2 to 1.26.0
PR-URL: https://github.com/nodejs/node/pull/67257
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-12 18:00:43 +01:00
Fuma 6e90b7ca31 doc: update readable.read() for v26 one-chunk behaviour
Signed-off-by: Fuma2514 <fuma2514@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/67341
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-12 18:00:43 +01:00
Antoine du Hamel 6e292ec34a tools: aggregate Nix changes in a table
On large updates, the raw diff is not really human parsable. It can
sometimes exceed the maximum length for comments, resulting in no diff
being shown.
To make reviews easier / more likely to spot something wrong, it now
outputs a table, and report failures in PR checks.

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67348
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-12 18:00:43 +01:00
Caleb Everett b0c030c3d1 child_process: inherit a reassigned process.env
Since v26.11.0, spawning without options.env builds the child's
environment from the OS environment block. Code that replaces
process.env, e.g. process.env = { ...process.env, FOO: 'x' }, had its
changes silently dropped. The child_process docs give process.env as
the default for options.env, and { env: process.env } still saw the
replacement object, so the two disagreed.

Make getEnvPairs() take the object to read and return undefined unless
it is still the native env proxy. When it isn't, copy process.env as
before. A plain object is copied without going through the env
interceptors, so that path stays cheap.

Assisted-by: a closed-source coding agent
Signed-off-by: Caleb ツ Everett <calebev@amazon.com>
PR-URL: https://github.com/nodejs/node/pull/66883
Fixes: https://github.com/nodejs/node/issues/66882
Refs: https://github.com/nodejs/node/pull/65325
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-11-12 18:00:42 +01:00
Christian Aurich Zanettini Martins d59e71d80f fs: keep readFile abortable on non-regular files
`ReadFileJob` treats a file that is not a regular file as size 0 and
reads it to EOF inside one thread pool job, so the `AbortSignal` is
only checked once the job ends. `fs.readFile()` and
`fs.promises.readFile()` on a FIFO whose writer stays open therefore
do not settle until the writer closes, and on `/dev/zero` they keep
growing the buffer until the process runs out of memory.

Hand the fd back to the chunked reader for non-regular files, the path
files larger than one chunk already take. It checks the signal before
each read. Regular files that report size 0, such as procfs files, are
still read in one job.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66940
Refs: https://github.com/nodejs/node/pull/65327
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-11-12 18:00:42 +01:00
Efe Karasakal f00c4f6430 doc: add efekrskl to collaborators
Fixes: https://github.com/nodejs/node/issues/67117

Signed-off-by: Efe Karasakal <hi@efe.dev>
PR-URL: https://github.com/nodejs/node/pull/67376
Fixes: https://github.com/nodejs/node/issues/67117
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
Reviewed-By: Philipp Dunkel <pip@pipobscure.com>
2026-11-12 18:00:42 +01:00
Philipp Dunkel 293fbcc0cd doc: add Philipp Dunkel to contributors
Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: https://github.com/nodejs/node/pull/67378
Fixes: https://github.com/nodejs/node/issues/67104
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
2026-11-12 18:00:42 +01:00
Christian Aurich Zanettini Martins d8db12ede8 doc: add christianaurichzm to collaborators
Fixes: https://github.com/nodejs/node/issues/67105
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67377
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-11-12 18:00:42 +01:00
Jason Zhang 9960109e99 fs: resolve symlinks before parent components
The JavaScript implementation of `fs.realpath()` and
`fs.realpathSync()` joined a symlink target with the rest of the path
through `path.resolve()`, which collapses `..` lexically before the
preceding components have been resolved. A link such as
`d -> c/../d`, where `c` is itself a symlink, was therefore rewritten
back to `d` and the walk never terminated.

Keep `.` and `..` in the path while walking it, and apply `..` to the
already resolved parent, matching `realpath(3)` and
`fs.realpathSync.native()`. Only normalize the final result, and skip
caching link targets containing `..`, whose resolution depends on the
path walked before them.

Thsi is a POSIX only fix. Windows is unaffected.

Signed-off-by: jazelly <xzha4350@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65457
Fixes: https://github.com/nodejs/node/issues/60295
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2026-11-12 18:00:42 +01:00
Yohannes Desta 942fd1b903 fs: fix cpSync() abort when dest is a dangling symlink
CpSyncCheckPaths() used the throwing overload of
std::filesystem::equivalent(), which fails when dest is a dangling
symlink. The uncaught C++ exception aborted the process. Use the
std::error_code overload instead: a dangling dest is not the same file
as src, so the copy goes ahead and replaces the link.

Fixes: https://github.com/nodejs/node/issues/67141
Signed-off-by: yohannesjoya <yohannesdestagebru10@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67142
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-11-12 18:00:42 +01:00
Node.js GitHub Bot 0bd4e80001 deps: update simdjson to 5.1.1
PR-URL: https://github.com/nodejs/node/pull/67332
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-12 18:00:42 +01:00
Node.js GitHub Bot 4db6f865e7 test: update WPT for WebCryptoAPI to e87deca336
PR-URL: https://github.com/nodejs/node/pull/67330
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-12 18:00:41 +01:00
Daijiro Wachi cf2a3eb1f3 doc: fix process import in test runner workerId example
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67316
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-11-12 18:00:41 +01:00
Yuya Inoue cd4e1417db test: deflake test-runner-mock-timers-scheduler
The first test case checked that the mocked `scheduler.wait(4000)`
resolved within 100ms of real wall-clock time. On slow or busy CI
machines the time between `Date.now()` and the promise callback can
exceed 100ms even though the mock works, so the test failed with
"time should be advanced less than the 100ms".

Replace the wall-clock assertion with a deterministic check: after
`tick(4000)`, wait one turn of the event loop and assert the promise
has settled. A real 4000ms timer cannot fire within that window, so
the check still proves the mocked timer was used. This matches how the
other cases in the file verify the mock.

Refs: https://github.com/nodejs/reliability/issues/1354
Refs: https://github.com/nodejs/reliability/issues/1278
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67296
Refs: https://github.com/nodejs/node/actions/runs/42153384377
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-11-12 18:00:41 +01:00
Yuya Inoue 1d8f0e0930 build: separate host and target Rust artifacts in cross builds
Capture the Rust target and host triples during configure for bundled
Temporal cross builds. Use explicit Cargo targets and separate output
directories so host and target archives do not share a build rule.

If the triples cannot be determined, disable Temporal with a warning
unless it was explicitly enabled.

Fixes: https://github.com/nodejs/node/issues/66897
Refs: https://github.com/nodejs/node/issues/66803
Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66823
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-12 18:00:41 +01:00
Trivikram Kamat 831d5a12da ffi: reject multi-argument buffer fast trampolines
The arm64 and x86_64 SysV emitters convert each buffer argument with a
helper call after loading earlier arguments into their target registers.
The call clobbers those registers, so the target would receive wrong
values for every argument before the buffer.

This is not reachable today: buffer-typed trampolines are generated only
for single-argument signatures. Reject other shapes in the emitters so a
future caller falls back instead of miscompiling.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/67046
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-12 18:00:41 +01:00
Matteo Collina 3a85380c63 tls: reject hostnames with forbidden code points
domainToASCII() is implemented with the URL host parser, which stops at
path, query and fragment delimiters and percent-decodes. Passing a
hostname through it can therefore silently shorten the name, so
checkServerIdentity() validates a certificate against a host the
application never asked for: name resolution and SNI use the original
string, while the certificate is matched after normalization. Reject
hostnames containing a WHATWG forbidden host code point before matching.
None of these code points is valid in a DNS hostname, so failing closed
is safe.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67254
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-12 18:00:41 +01:00
Matteo Collina 632576930e worker: preload streams into startup snapshot
Worker stdio loads stream after restoring the main-thread context,
initializing its constructors and prototype methods on every startup.
Preload stream during snapshot construction so workers can restore that
initialized state instead. Worker-specific stdio instances and message
ports are still created at runtime.

Verify snapshot membership, stdio methods, and isolation from
parent-thread stream mutations.

Assisted-by: pi
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66311
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2026-11-12 18:00:41 +01:00
Matteo Collina 3c334ad92d stream: trim webstreams sink wrappers and BYOB transfers
The close and abort methods of an underlying sink and the flush and
cancel methods of a transformer were each wrapped at construction in an
async closure that the controller kept for the stream's lifetime: two
per WritableStream and two per TransformStream, each with its context.
Store these one-shot methods as-is in the controller state next to the
object they belong to, and call them as that object's methods with the
spec's argument list through a promiseCall helper that keeps the
reference implementation's adoption ticks. The per-chunk methods (write,
transform) keep their closures, which make the method a constant for the
optimizing compiler on the hot paths; so does the source's cancel
wrapper, since the readable stream's construction path is sensitive to
any change in its inlining budget.

In the byte controller, the transfer of a pull-into descriptor's buffer
when it is committed is dropped: nothing can reach that buffer any more,
since it was transferred when the descriptor was created and the BYOB
request that exposed it is only ever invalidated together with a
transfer. The transfer of the first pending descriptor's buffer on
enqueue is likewise only needed while a BYOB request exposes it.
Allocating an ArrayBuffer costs about half a microsecond, so those two
transfers were a large part of a BYOB read.

Bytes allocated per stream with user methods: WritableStream 1040 ->
844, TransformStream 1816 -> 1720. The microtask ordering of every user
method call is unchanged.

Benchmark results (20 runs, vs. the previous commit):

    webstreams/readable-read.js type='byob' n=100000           ***   17.14 %  ±1.80%
    webstreams/readable-async-iterator.js type='normal' n=100000        3.79 %  ±4.49%
    webstreams/from.js kind='sync' n=1000000                     *   -2.18 %  ±2.02%
    webstreams/js_transfer.js n=10000 payload='TransformStream'   *   -1.85 %  ±1.58%

The other 42 rows are within their confidence intervals; the two rows at
the 5% level are the expected number of false positives for 46
comparisons.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66702
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-12 18:00:41 +01:00
Matteo Collina 8554feb650 test: deflake test-worker-eventlooputil
worker.performance.eventLoopUtilization() reads the worker's idle time
before the current time. If the parent thread stalls between the two
reads while the worker is idle, the stall is counted as worker active
time in the first sample and is missing from the delta, so the 50ms
spin can be reported as slightly less than 50ms.

Bound that skew by timing the first workerELU() call.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67260
Refs: https://github.com/nodejs/reliability/issues/1482
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-12 18:00:41 +01:00
Yuya Inoue 8d0b5894fd build: refresh markdown lint dependencies on lockfile changes
Reinstall markdown lint dependencies when the lockfile changes and
recheck all Markdown files with the updated rules.

Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67185
Refs: https://github.com/nodejs/node/pull/67023
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-12 18:00:40 +01:00
Yuya Inoue 4c9f87877c http2: preserve multiple content-encoding values
Remove content-encoding from the single-value field set so incoming
values are joined in order and outgoing arrays are accepted.

Update the header documentation and add coverage for requests and
responses, including repeated codings and strict validation options.

For repeated fields, the incoming value now includes every coding
instead of only the first. Outgoing arrays no longer throw
ERR_HTTP2_HEADER_SINGLE_VALUE by default.

Fixes: https://github.com/nodejs/node/issues/67151
Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67184
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-12 18:00:40 +01:00
Jay 730c582463 test: skip readFileSync pipe test without proc io
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/67242
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2026-11-12 18:00:40 +01:00
Yuya Inoue 86d5cd6ec9 tools: use ubuntu-latest for public lint-js-and-md jobs
Use ubuntu-latest in public repositories to reduce runtime and
provide more headroom when the ESLint cache cannot be restored.

Keep ubuntu-slim in private repositories to avoid increasing
runner costs.

Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66409
Refs: https://github.com/nodejs/node/issues/64972
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-12 18:00:40 +01:00
Guilherme Araújo 5becd96658 sqlite: add ReadOptionalString helper
Use it for the dbName, table, db, source and target options so they
all treat a missing or undefined value as the default. Also mark
ReadOptionalBool and ReadOptionalString as [[nodiscard]].

Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67042
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-11-12 18:00:40 +01:00