Commit Graph
48964 Commits
Author SHA1 Message Date
Joyee Cheung a9cc80dd34 deps: V8: cherry-pick 00508c374a45
Original commit message:

    Add V8_HAS_WARNING for portable warning checks

    GCC does not provide the function-like __has_warning macro. Invoking it
    in a compound preprocessor condition causes a preprocessing error even
    when __clang__ is false.

    Add V8_HAS_WARNING to v8config.h, following existing feature-detection
    helpers. Use it for warning guards in base/macros.h. Compilers without
    __has_warning now use the fallback value of zero.

    Change-Id: I41d10799fd6f73a8bacbd3648aa0bb792d6b80cd
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8385383
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Reviewed-by: Maksim Ivanov <emaxx@google.com>
    Cr-Commit-Position: refs/heads/main@{#109976}

Refs: https://github.com/v8/v8/commit/00508c374a45e53e20e48cb103d512befed8cc43
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:44 +00:00
Steven R. Loomis 801d1c7a39 deps: V8: backport 9fb4444bfc46
Original commit message:

    Fix Temporal compilation with system or no ICU

    build: Fix Temporal compilation with system or no ICU

    Add new build flag, v8_enable_temporal_systemicu, off by default When
    on, it will remove references to the internal ICU udatamem.h header file

    Obviates CLs 7769990 / 7831715

    See: https://unicode-org.atlassian.net/browse/ICU-23400 See: Node:
    https://github.com/nodejs/node/issues/62676 See: V8:
    https://chromium-review.googlesource.com/c/v8/v8/+/7831715 See:
    Homebrew: https://github.com/Homebrew/homebrew-core/pull/281707
    Change-Id: Ibc460c68189d32e154c53eddfcda56bc7bca4fc6

    Also includes:

    fix: fix for no-icu build

    thanks @aduh95
    https://github.com/nodejs/node/issues/62676#issuecomment-5371270979

    NO_IFTTT=No Temporal via Bazel

    Change-Id: Ibc460c68189d32e154c53eddfcda56bc7bca4fc6
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8281487
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Commit-Queue: Chengzhong Wu <cwu631@bloomberg.net>
    Reviewed-by: Olivier Flückiger <olivf@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#110039}

Refs: https://github.com/v8/v8/commit/9fb4444bfc464a5e54219acb04f0828b83dd15b5
Fixes: https://github.com/nodejs/node/issues/62676
Refs: https://github.com/srl295/v8/commit/cd89fe6f7acb6f5d069f6cc741fa68303214e98f
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:43 +00:00
Eliau Elkouby 938487505f deps: V8: cherry-pick 786c1c2d88d4
Original commit message:

    [stack-traces] Fix overflow in Error.stackTraceLimit trimming

    When stack traces are captured for uncaught exceptions (enabled via
    Isolate::SetCaptureStackTraceForUncaughtExceptions, e.g. by the
    inspector or by Node.js's --trace-uncaught), CaptureAndSetErrorStack
    reuses the simple stack trace and trims it to Error.stackTraceLimit.

    Error.stackTraceLimit counts frames, but the raw call site data stores
    CallSiteInfo::Fields::kCount slots per frame, so the trim multiplied the
    limit by kCount: once in the uint32_t comparison against the array
    length and once, as int, to compute the new length. GetStackTraceLimit
    clamps the limit to [0, INT_MAX], so for very large limits the uint32_t
    product can wrap to a value below the array length. The trim branch is
    then taken although the limit exceeds the number of captured frames,
    and the int multiplication of the new length overflows.

    On main (kCount == 5) the product first wraps at 858993460. That limit
    trimmed the raw data to 4 slots (no complete frame) and 858993461 to 9
    slots (one frame), so error.stack silently lost frames. Infinity, the
    value from the Node.js report, is clamped to INT_MAX; its wrapped
    product (2147483643) is not below the array length, so on main it does
    not take the trim branch and does not reach the signed overflow.

    Fix this by comparing the limit with the number of frames in the raw
    data (length / kCount), and only multiplying once the limit is known to
    be smaller than the frame count. The resulting length is then bounded
    by the existing array length and cannot overflow. Behavior for limits
    that did not overflow is unchanged, since the raw data length is always
    a multiple of kCount.

    This regressed with https://crrev.com/c/7673818 (ebd15783b7b,
    "[objects]: Defer CallSiteInfo creation"), which switched from one
    CallSiteInfo per frame to kCount raw slots per frame.

    This is the underlying cause of Node.js issue 66074. The symptom there
    differs from main: Node's V8 14.6 backport of that change has
    kCount == 6 and uses int for the comparison and for RightTrim, so the
    product overflows for limits above 357913941. For many of those,
    including Infinity (INT_MAX * 6 wraps to -6), the result is negative
    and fails "Check failed: new_capacity > 0." in RightTrim. Comparing in
    frames avoids the overflow in both cases.

    The new cctest CaptureStackTraceForUncaughtExceptionHugeStackTraceLimit
    enables capture for uncaught exceptions and checks that limits of
    858993460, 858993461 and Infinity yield the same error.stack as a limit
    of 10, and that a limit of 1 still trims to a single frame. 858993460
    and 858993461 are the first limits whose product with kCount wraps
    around uint32_t; both fail without this change. The new test and the
    existing stack trace tests also pass in a UBSan build, with no
    diagnostics.

    Bug: 565047704
    Refs: https://github.com/nodejs/node/issues/66074
    Change-Id: I3422ca1de6a7dd9448c7fd53fb9bc5e40e2a17c1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8426465
    Reviewed-by: Patrick Thier <pthier@chromium.org>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Auto-Submit: eliau elkouby (‫אליהו אלקובי‬‎) <eliau.elkouby@gmail.com>
    Commit-Queue: Patrick Thier <pthier@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#110043}

Refs: https://github.com/v8/v8/commit/786c1c2d88d445eecf54efe7ba9cef27a3eef3bb
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:42 +00:00
Joyee Cheung e7db80914f deps: V8: cherry-pick 820f3d72a638
Original commit message:

    [simd] Disable SVE implementation of array search for older ClangCL

    The Microsoft C++ ABI mangler in older ClangCL cannot mangle
    these built-ins. Disable SVE in this case.

    Refs: https://github.com/llvm/llvm-project/issues/196170
    Refs: https://github.com/nodejs/node/pull/65161
    Change-Id: I35e49dd4bfc0617bfa31cb7e3af1a475b4fb1bef
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8420284
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#109945}

Refs: https://github.com/v8/v8/commit/820f3d72a638359ebc81afff385d3de6f0180778
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:41 +00:00
ishabi 2551a56021 deps: V8: cherry-pick 315d9c945ac3
Original commit message:

    Solaris: implement Stack::ObtainCurrentThreadStackReservedLimit

    Port 5a54f45b671bdf47e083ffbad547713d8bacb28f

    Solaris is excluded from the generic POSIX implementation, so implement
    the function using pthread_attr_get_np() and pthread_attr_getstack(),
    consistent with ObtainCurrentThreadStackStart(). The base returned by
    pthread_attr_getstack() maps to the lowest address of the thread's
    reserved stack.

    Change-Id: I08a5b4cd80180b04496b22989cb976d1c24ce8e6
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8413453
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Reviewed-by: Joyee Cheung <joyee@igalia.com>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#109953}

Refs: https://github.com/v8/v8/commit/315d9c945ac3b1612c3690fbe69e48acce263bed
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:40 +00:00
ishabi bfd74f89dd deps: V8: cherry-pick 37baecdd9479
Original commit message:

    [base] Guard int8_t ReadUnalignedValue overload on Solaris

    On Solaris, int8_t is a typedef for char, so this overload collides with
    ReadUnalignedValue(const char*) and fails to compile. Guard it with
    V8_OS_SOLARIS, as already used elsewhere in the platform code.

    Introduced in:
    https://chromium-review.googlesource.com/c/v8/v8/+/7900500

    Change-Id: I87c65412f412b6cf4de1f53ccaca539c1ce8c033
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8409815
    Reviewed-by: Maya Lekova <mslekova@chromium.org>
    Reviewed-by: Anton Bikineev <bikineev@chromium.org>
    Reviewed-by: Joyee Cheung <joyee@igalia.com>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#110014}

Refs: https://github.com/v8/v8/commit/37baecdd9479ce61a12494ef6fdd271ac721964d
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:39 +00:00
Joyee CheungandStefanStojanovic fd1aba0dfa deps: V8: cherry-pick 99ebeac9c548
Original commit message:

    [torque] Fix C++ object layout assertions for MSVC STL

    The assertions generated for @cppObjectLayoutDefinition classes assume
    that the first field of a derived class starts at sizeof(Parent) and
    that sizeof(Class) == the packed size computed by Torque. Both
    assumptions break when compiling with the MSVC STL, which stores
    std::atomic<T> with alignas(sizeof(T)). Under the Microsoft C++ ABI an
    alignas() is a required alignment that #pragma pack cannot lower, so the
    std::atomic bit fields of Map force Map, and in turn the pack(1)
    ExtendedMap, to align by 4 bytes. After rounding up,

    sizeof(ExtendedMap) == sizeof(Map) + 4 == kSize + 3

    so

    static_assert(kSize == sizeof(ExtendedMap))

    fails. The base subobject size is not rounded up
    however, so JSInterceptorMap places its first field at sizeof(Map) + 1
    rather than sizeof(ExtendedMap), and

    static_assert(kFlagsOffset == offsetof(JSInterceptorMap, flags_))

    fails as well.

    Fix this by:

    - Using the packed parent size that Torque already knows as the offset
      of the first derived field instead of sizeof(Parent).
    - Relaxing the assertion to only require that sizeof(Class) does not
      exceed kSize by alignof(Class) or more, so that any extra bytes fit
      into the alignment padding.

    Co-Authored-By: StefanStojanovic <stefan.stojanovic@janeasystems.com>
    Refs: https://github.com/nodejs/node/pull/65161
    Bug: 531344950
    Change-Id: I16811484a8ff3d1bff187bab950ac71b6ea7f297
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8486028
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#110223}

Refs: https://github.com/v8/v8/commit/99ebeac9c548e36f9e18658097df0b6c42b1c71c
Co-Authored-By: StefanStojanovic <stefan.stojanovic@janeasystems.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:38 +00:00
Joyee Cheung f0273edb9e deps: V8: cherry-pick b2fc93f37507
Original commit message:

    Avoid backslash at the end of the comments

    This triggers -Wcomment in GCC. Switch to a different diagram style
    to avoid it.

    Change-Id: Iaadabdecb76de21937def43cbac817470a90c735
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8480492
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#110151}

Refs: https://github.com/v8/v8/commit/b2fc93f3750779f42fb83f3d51ae8817c2ae931d
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:37 +00:00
Joyee Cheung 26cc118a75 src: update NODE_MODULE_VERSION to 152
Major V8 updates are usually API/ABI incompatible with previous
versions. This commit adapts NODE_MODULE_VERSION for V8 15.5.

Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:36 +00:00
Joyee Cheung 520388f362 build: reset embedder string to "-node.0"
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:35 +00:00
Joyee Cheung d5a8930d0f deps: update Rust crates for V8 15.5.35.20
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:34 +00:00
Joyee Cheung 6b28cb0909 deps: update V8 to 15.5.35.20
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66537
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-07 18:54:32 +00:00
RafaelGSS cd18965041 lib: set exit code on failed node:bench run()
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66534
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-10-07 15:39:57 -03:00
RafaelGSS 299f76cb73 lib: default node:bench warmup to 10 invocations
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66536
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2026-10-07 15:38:44 -03:00
René a7e9f3b3ae src: use native CopyArrayBufferBytes for webstream buffer copy
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/66400
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-07 16:00:15 +00:00
Node.js GitHub Bot 4fa5145b06 2026-10-07, Version 26.11.0 (Current)
Notable changes:

buffer:
  * (SEMVER-MINOR) add isLatin1 (James M Snell) https://github.com/nodejs/node/pull/66298
  * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) https://github.com/nodejs/node/pull/66064
build, doc:
  * move to redesign (Aviv Keller) https://github.com/nodejs/node/pull/62045
doc:
  * promote Alpine Linux to tier 2 support (Stewart X Addison) https://github.com/nodejs/node/pull/63737
http:
  * (SEMVER-MINOR) add isValidHeaderName() and isValidHeaderValue() (James M Snell) https://github.com/nodejs/node/pull/66334
http2:
  * (SEMVER-MINOR) add new connectionWindowSize option (Tim Perry) https://github.com/nodejs/node/pull/65619
perf_hooks:
  * (SEMVER-MINOR) fix truncation of monitorEventLoopDelay() resolution (James M Snell) https://github.com/nodejs/node/pull/66115
  * (SEMVER-MINOR) allow RecordableHistogram to record 0 (James M Snell) https://github.com/nodejs/node/pull/66114
  * (SEMVER-MINOR) add histogram.diff() (James M Snell) https://github.com/nodejs/node/pull/66099
  * (SEMVER-MINOR) add histogram.snapshot() (James M Snell) https://github.com/nodejs/node/pull/66099
  * (SEMVER-MINOR) harden histogram CBOR import validation (James M Snell) https://github.com/nodejs/node/pull/66098
process:
  * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) https://github.com/nodejs/node/pull/66213
sqlite:
  * (SEMVER-MINOR) rename DatabaseSync and StatementSync (Guilherme Araújo) https://github.com/nodejs/node/pull/65988
src:
  * (SEMVER-MINOR) add --process-timeout=N (James M Snell) https://github.com/nodejs/node/pull/66138
  * (SEMVER-MINOR) expose size and count in heap profile output (Ilyas Shabi) https://github.com/nodejs/node/pull/65737
  * (SEMVER-MINOR) let embedders exempt linked bindings from the addon permission (Shelley Vohr) https://github.com/nodejs/node/pull/66067

PR-URL: https://github.com/nodejs/node/pull/66546
2026-10-07 16:40:44 +02:00
Antoine du Hamel 49d2d81d1c doc: clarify revert PR label policy
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66529
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-10-07 16:29:15 +02:00
Filip Skokan 554dd55eb8 crypto: isolate provider EC PKCS8 encoding
OpenSSL's provider ec_pki_priv_to_der() temporarily changes EC_KEY
encoding flags on the input key. Concurrent PKCS8 exports can emit
inconsistent DER or affect a concurrent SEC1 export. The old Node key
mutex never covered this path.

Encode provider EC and SM2 keys through EVP_PKEY_dup(), preserving
encoding flags, point conversion form, parameters, and provider.
Legacy OpenSSL and BoringSSL already encode using local flags.

Restore concurrent KeyObject PKCS8 DER assertions and cover PEM and
SEC1 exports, including ECPrivateKey inputs without a public point.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66413
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 13:36:48 +00:00
Filip Skokan 9267ac84c0 crypto: remove key export and metadata locks
Raw and JWK getters return independently owned bytes or BIGNUMs. RSA
metadata snapshots public parameters and PSS restrictions. EC fallback
paths reconstruct or duplicate the source key. EC PKCS8 export changes
encoding flags only on its own clone.

Early OpenSSL 3 key downgrading mutated shared provider fields. Current
OpenSSL publishes separate legacy and provider conversion caches under
internal read/write locks. Ordinary DER/PEM export, equality, signing,
and key derivation already access the same keys without these locks.

Remove export and metadata acquisitions, including their coverage of V8
allocation and encoding, and remove the now-unused shared mutex storage.
Retain shared immutable key ownership. The concurrent reuse test checks
that EC PKCS8 export leaves the original flags intact.

Refs: https://github.com/nodejs/node/pull/36825
Refs: https://docs.openssl.org/3.5/man7/openssl-threads/
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66413
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 13:36:45 +00:00
Filip Skokan d2a27eec99 crypto: remove verify setup key locking
Verify configuration only copies signature bytes and reads DSA/EC order
width for P1363 conversion. Conversion constructs independent DER and
BIGNUM values. Signing and verification already run without the mutex
using separate operation contexts.

Cover cold shared public keys and worker clones with checked P1363
verification while signatures, derivation, exports, metadata queries,
and equality checks overlap.

Compare source PKCS8 encoding after workers finish. OpenSSL's ordinary
EC PKCS8 encoder temporarily changes source flags and races even on the
unmodified base. Keep WebCrypto PKCS8 exports concurrent through their
independent clones.

Refs: https://github.com/nodejs/node/pull/36825
Refs: https://github.com/nodejs/node/pull/37816
Refs: https://docs.openssl.org/3.5/man7/openssl-threads/
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66413
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 13:36:43 +00:00
Filip Skokan 3dbbdd0798 crypto: remove KEM key locking
ncrypto::KEM creates a new EVP_PKEY_CTX per operation. Parameters,
entropy, scratch buffers, and outputs are private to each call. ML-KEM
expansion finishes during import, and operations read an immutable key.
EC and X25519 retain read-only recipient keys. RSA synchronizes mutable
caches internally.

Remove the outer locks serializing jobs that share a KeyObject or
CryptoKey. Cover cold keys and worker clones across RSA, EC, X25519, and
ML-KEM, checking every resulting shared secret.

Refs: https://docs.openssl.org/3.5/man7/openssl-threads/
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66413
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 13:36:40 +00:00
Filip Skokan 4775f2b222 crypto: remove RSA-OAEP key locking
RSA_Cipher delegates to ncrypto::Rsa with a new EVP_PKEY_CTX per
operation. Padding, digests, labels, and output buffers belong to that
context. OpenSSL and BoringSSL synchronize RSA blinding and Montgomery
caches internally.

The lock was introduced for early OpenSSL 3 key downgrading that cleared
shared provider fields. Current OpenSSL publishes a separate legacy
cache under its own lock.

Cover cold shared CryptoKeys and worker clones with concurrent
encrypt/decrypt, synchronous KeyObject aliases, and checked plaintexts.

Refs: https://github.com/nodejs/node/pull/36825
Refs: https://docs.openssl.org/3.5/man7/openssl-threads/
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66413
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 13:36:37 +00:00
Filip Skokan bacbcdcf0a crypto: skip secret key mutex allocation
Secret key bytes are immutable after KeyObjectData construction. AES,
ChaCha20-Poly1305, MAC, and KDF jobs read those bytes without acquiring
KeyObjectData::mutex(), and secret-key export and equality do the same.

Do not allocate a shared mutex that none of these operations uses.
Asymmetric key mutex initialization remains eager so copies continue to
share the same lock while asymmetric acquisitions remain.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66413
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 13:36:34 +00:00
Rafael Gonzaga aa8d6b9384 doc: clarify node binary misuse after compromise
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66530
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-10-07 13:36:17 +00:00
Shelley Vohr 06c6e36ee5 tools: lint thread_local in src
Several Environments can share a thread, so state in src/ that belongs
to one of them cannot be kept in a thread_local. Add a cpplint rule
that rejects thread_local in src/ unless the declaration is marked with
NOLINTNEXTLINE(runtime/thread_local), and mark the existing uses, which
are per-thread by design.

Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66411
Refs: https://github.com/nodejs/node/pull/66239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-07 10:56:09 +00:00
Shelley Vohr 07500390fb quic: give each BindingData its own allocator state
The ngtcp2 and nghttp3 allocators shared one thread_local state whose
BindingData pointer was set by the last BindingData that handed out an
allocator. With several Environments on a thread, memory allocated for
a session in one Environment was accounted against another's
BindingData and failed a CHECK when freed.

Give each BindingData its own heap-allocated state. nghttp3 buffers
backing external strings can be freed after the BindingData is gone,
so the state counts live allocations and is deleted once the
BindingData has been destroyed and the last of them is freed.

Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66411
Refs: https://github.com/nodejs/node/pull/66239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-07 10:56:08 +00:00
Shelley Vohr 71a657ac22 crypto: keep the root cert store per Environment
The root cert store and the certificates set through
tls.setDefaultCACertificates() were thread_local, with a cleanup hook on
whichever Environment used TLS first. When several Environments share a
thread, setting the default CA certificates in one of them replaced the
trusted CAs of the others. Keep both on the Environment, next to its
other OpenSSL state.

Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66411
Refs: https://github.com/nodejs/node/pull/66239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-07 10:56:07 +00:00
Filipe Oliveira (Redis) a2b4f55d5b tools: copy hdr_histogram_internal.h in update-histogram.sh
HdrHistogram_c 0.12.0 added a private header,
src/hdr_histogram_internal.h, which src/hdr_tests.h now includes.
update-histogram.sh copies a fixed list of files, so the automated
update to 0.12.0 would leave deps/histogram without it and fail to
compile. Add the header to the list.

Signed-off-by: fcostaoliveira <filipe@redis.com>
PR-URL: https://github.com/nodejs/node/pull/66528
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-10-07 09:51:15 +00:00
Trivikram Kamat 4dfcf1d2e9 sqlite: persist enableDefensive() across reopen
`enableDefensive()` updated only the live connection, so after
`close()` and `open()` the defensive flag went back to the value
passed to the constructor. Store the new value in the open
configuration so that `open()` applies it again.

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/66404
Fixes: https://github.com/nodejs/node/issues/66403
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
2026-10-07 06:41:31 +00:00
Issac a0db728137 doc: document linux-x64-musl build toolchain
Add the build platform and compiler for official musl binaries.

Signed-off-by: Ji Hoon Kang <ivory.ma9ic@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66523
Fixes: https://github.com/nodejs/node/issues/66506
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 06:41:15 +00:00
Trivikram Kamat aa1bf2cc37 sqlite: throw on oversized strings instead of aborting
Several conversions from SQLite text to V8 strings passed a length of
-1 to String::NewFromUtf8(). With that length, V8 skips its length
check and aborts the process when the UTF-8 text exceeds
String::kMaxLength.

SQLite error messages embed the offending identifier or token, so
CreateSQLiteErrorImpl() could hit this. NullableSQLiteStringToValue(),
used for setAuthorizer() callback arguments and statement.columns()
metadata, had the same problem, and the authorizer also called
ToLocalChecked() on each argument.

Convert error messages with Utf8StringMaybeOneByte(), and check the
length up front in NullableSQLiteStringToValue(), so oversized strings
throw ERR_STRING_TOO_LONG as column values already do. In the
authorizer, deny the action and let the pending error reach the caller.

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/66521
Fixes: https://github.com/nodejs/node/issues/66520
Fixes: https://github.com/nodejs/node/issues/66522
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 02:13:23 +00:00
github-actions[bot] 1bcf30b52a doc: run license-builder
PR-URL: https://github.com/nodejs/node/pull/66517
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-07 00:21:41 +00:00
Geoffrey Booth c89ec290f0 module: synchronously load most ES modules
Signed-off-by: Geoffrey Booth <webadmin@geoffreybooth.com>
PR-URL: https://github.com/nodejs/node/pull/62530
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-10-06 17:40:45 +00:00
Christian Aurich Zanettini Martins a4f6d7587b quic: validate session close error codes
`session.close()` and `session.destroy()` only checked that
`options.code` was a bigint or a number. Numbers were then converted
to `uint64_t` unchecked, so fractions were truncated and negative,
non-finite or too large values were undefined behavior. Bigints were
only checked to fit in 64 bits, but QUIC error codes are
variable-length integers limited to 62 bits, so larger codes cannot
be encoded in the `CONNECTION_CLOSE` frame.

Reject codes that are not integers between `0` and `2n ** 62n - 1n`,
the range `QuicError` already enforces, before any close or destroy
side effects.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66302
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-10-06 17:40:30 +00:00
Christian Aurich Zanettini Martins 8314231539 quic: destroy stream on invalid promise body
When `setBody()` receives a promise that resolves to an unsupported
body type, `configureOutbound()` throws inside the fulfillment
handler. The rejection handler only covered the original promise, so
the error rejected a discarded promise and crashed the process as an
unhandled rejection.

Catch errors thrown by `configureOutbound()` in the fulfillment
handler and destroy the stream with them, as the rejection handler
already does. For an unsupported resolved value, `stream.closed` now
rejects with the same `ERR_INVALID_ARG_TYPE` that `setBody()` throws
synchronously.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66260
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-10-06 17:17:15 +00:00
Trivikram Kamat 57bb81779b watch: strip underscore aliases of watch flags
The C++ option parser treats `_` and `-` as the same character in
option names, so `--watch_path` is the same as `--watch-path`.

Watch mode compared spellings literally when it removed its own flags
from `process.execArgv` and `NODE_OPTIONS` before spawning the child.
The underscore spellings got through, so each child went back into
watch mode and spawned another child, and the application never ran.

Normalize option names before comparing them. Forward the original
arguments to the child unchanged.

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/66365
Fixes: https://github.com/nodejs/node/issues/66364
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-10-06 15:59:00 +00:00
James M Snell 3a4454151a http: add websocketMask() and websocketUnmask()
Add websocketMask(source, mask, output[, offset[, length]]) and
websocketUnmask(buffer, mask), which XOR data with a repeating 4-byte
key. This is the masking that WebSocket clients apply to every frame
they send (RFC 6455, Section 5.3), and that servers undo on every frame
they receive.

Userland WebSocket implementations do this either with a byte-by-byte
JS loop (undici, and ws without optional dependencies) or with the
bufferutil native addon. bufferutil is installed for only about 3% of
ws downloads and has no linux-arm64 prebuild, so almost all users run
the JS loop. The signature matches bufferutil, so existing users can
switch with a feature check, as ws did for buffer.isUtf8().

The implementation uses a V8 fast API call and processes 8-byte words,
which the compiler vectorizes. It handles overlapping source and output
views, and treats every view type as raw bytes. It is about 20x faster
than the JS loop at 1 KiB and 40x faster at 64 KiB, and faster than
bufferutil at every size from 32 bytes up.

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
PR-URL: https://github.com/nodejs/node/pull/66335
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2026-10-06 11:36:02 +00:00
Guilherme Araújo fcfb7ecc0b test_runner: add mock call assertions to t.assert
Add t.assert.called(), t.assert.callCount(), t.assert.nthCalledWith()
and t.assert.lastCalledWith() for asserting on mock function calls.

Assisted-by: Claude
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66476
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-06 05:55:47 +00:00
Node.js GitHub Bot 9a85290d86 test: update WPT for WebCryptoAPI to 3127c3a492
PR-URL: https://github.com/nodejs/node/pull/66492
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-06 01:40:14 +00:00
Node.js GitHub Bot 1271bb448a deps: update histogram to 0.12.0
PR-URL: https://github.com/nodejs/node/pull/66494
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-06 01:40:04 +00:00
Node.js GitHub Bot 57df50e98c test: update test426-fixtures to 9ea66b466fd37e8a4050033d23b3e1480973c3d
PR-URL: https://github.com/nodejs/node/pull/66493
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2026-10-06 01:39:53 +00:00
Node.js GitHub Bot 01008ba75d crypto: update root certificates to NSS 3.129
This is the certdata.txt[0] from NSS 3.129.

This is the version of NSS that shipped in Firefox 157.0 on 2026-09-29.

[0] https://raw.githubusercontent.com/nss-dev/nss/refs/tags/NSS_3_129_RTM/lib/ckfw/builtins/certdata.txt

PR-URL: https://github.com/nodejs/node/pull/66496
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-10-06 01:39:42 +00:00
Matteo Collina 9746ebce07 net: race family autoselection attempts
Keep pending TCP connections alive when starting
 fallback attempts. The first successful connection wins; fixed
 local ports retain sequential attempts.

Assisted-by: pi coding agent
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66229
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-10-05 21:26:47 +00:00
Marco Ippolito 019e869ad3 src: fix config file handling
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66431
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2026-10-05 16:47:39 +00:00
Marco Ippolito 3c577146aa src: mark config file as stable
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66431
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2026-10-05 16:47:38 +00:00
Gaby Baghdadi c413d1acb4 build: update common.gypi for z/OS
- Don't use icu data file on z/OS; use libnode's bundled ICU data.
- Include required defines, cflags, ldflags, and remove unsupported
  ones, following switch to clang compiler.
- Remove _ALL_SOURCE, as _POSIX_C_SOURCE and _POSIX_SOURCE already
  enable all required library functions (in deps/uv/CMakeLists.txt, only
  _OPEN_SYS is required to enable setgroups (in grp.h) instead of
  _ALL_SOURCE); also remove dup _OPEN_SYS_SOCK_IPV6.
- Add -D_EXT to defines (for setenv, and vsam.js' `__KEY_*` macros).
- Add _POSIX_C_SOURCE=200809L to enable at least `utimensat`.
- Add clang option -mzos-target=zosv2r5 also to ldflags, otherwise the
  default LE dataset is used that may not be for the current target.
- Add -m64 to ldflags, otherwise ld passes `AMODE=31,LIST,..` to
  the binder, causing unresolved symbols if the non-64 suffixed version
  of the compiler was used (e.g. ibm-clang instead of ibm-clang64).
- Add zoslib/include-wrappers/c++ in include_dirs for custom aligned new
  and delete operators.

PR-URL: https://github.com/nodejs/node/pull/66449
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Signed-off-by: Gaby Baghdadi <baghdadi@ca.ibm.com>
Signed-off-by: Richard Lau <richard.lau@ibm.com>
2026-10-05 16:33:39 +00:00
Gaby Baghdadi 6c116e8415 build: update configure.py for z/OS
Signed-off-by: Gaby Baghdadi <baghdadi@ca.ibm.com>
PR-URL: https://github.com/nodejs/node/pull/66449
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-10-05 16:32:33 +00:00
Ved Chaudhari bbd566ddaf build: fix vcbuild format-md install and exit
Install the Markdown linter before formatting and exit afterwards.

Assisted-by: Claude Code
Signed-off-by: vedchaudhari <vedc2853@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66475
Refs: https://github.com/nodejs/node/pull/66467
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2026-10-05 12:38:17 +00:00
Yuya Inoue c4af8665f6 tools: limit format-cpp checkout history
Use the first parent of the PR merge commit as the formatting base,
allowing a depth-two checkout instead of fetching the full history.

Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66479
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2026-10-05 11:25:21 +00:00
Joyee Cheung 88ec31414c Revert "deps,lib,tools: remove jitless and lite modes"
Newer version of V8 no longer supports
--allow-overwriting-for-next-flag and there's no way to
override the preset flag now. Revert the commit to allow
users to opt-in into the flags if still necessary.

This reverts commit 7e39b8781a.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66516
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-10-05 11:25:07 +00:00