Commit Graph
48005 Commits
Author SHA1 Message Date
Antoine du Hamel 77ab945455 2026-11-30, Version 24.23.0 'Krypton' (LTS)
Notable changes:

buffer:
  * (SEMVER-MINOR) add Buffer.stringLength() (Matteo Collina) https://github.com/nodejs/node/pull/66064
  * (SEMVER-MINOR) add isLatin1 (James M Snell) https://github.com/nodejs/node/pull/66298
doc:
  * (SEMVER-MINOR) 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
perf_hooks:
  * (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) return unregister fn from finalization (Matteo Collina) https://github.com/nodejs/node/pull/66482
  * (SEMVER-MINOR) graduate process.ref/unref from experimental (James M Snell) https://github.com/nodejs/node/pull/66213
test_runner:
  * use AsyncLocalStorage instead of async_hooks (Matteo Collina) https://github.com/nodejs/node/pull/66795
  * (SEMVER-MINOR) add support for --test-coverage-include-all (Aviv Keller) https://github.com/nodejs/node/pull/64830

PR-URL: https://github.com/nodejs/node/pull/67663
2026-11-21 15:12:57 +01:00
Filip Skokan c039ef5ebd 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
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-21 14:47:07 +01:00
Tamir Duberstein 53d071b36c test: send SNI in CA certificate test
Set servername when connecting to www.nodejs.org so the server selects
its certificate for that hostname. Without SNI, it returns a certificate
that does not cover www.nodejs.org, and the test fails before exercising
CA handling. The nightly internet test is failing with this error [1].

Reproduce the certificate mismatch without Node.js:

    openssl s_client -connect www.nodejs.org:443 -noservername \
      -verify_hostname www.nodejs.org -verify_return_error </dev/null

This reports "verify error:num=62:Hostname mismatch". Replacing
-noservername with -servername www.nodejs.org succeeds.

[1]: https://github.com/nodejs/node/actions/runs/39084453901

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66835
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-11-21 14:47:07 +01:00
Ulises Gascon b50e7c3b2a tools: check notarization status when verifying macOS binaries
Signed-off-by: Ulises Gascon <UlisesGascon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/67541
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-21 14:47:07 +01:00
René 733b578c0d tools: update mk-ca-bundle to 1.35
Adds the facility to ignore root certificates by fingerprint using
mk-ca-bundle's -x parameter.

Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67403
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-21 14:47:07 +01:00
Ulises Gascón 7d50f8a9e0 tools: notarize bin/node in the darwin tarballs
The binary tarball target only codesigns bin/node. Notarization runs
only for the pkg, and tools/osx-notarize.sh only knows how to submit a
pkg, so every darwin tarball binary ships signed but without a ticket.
Gatekeeper then applies a full trust evaluation to each process spawned
through it, which slows down every CLI shim on macOS.

Make tools/osx-notarize.sh take a path instead of a version id. A .pkg
keeps the existing flow. Any other file is treated as a Mach-O binary:
it is zipped with ditto, submitted with notarytool, and the ticket is
verified with `codesign --verify -R=notarized` using the existing retry
helper. spctl cannot be used for that check, it rejects command line
tools as "not an app". The binary itself is not modified, so published
checksums do not change. A bare version id is still accepted and
resolved to node-<version>.pkg for the release branches.

Call the script from the binary target after codesign. It is a no-op
unless the NOTARIZATION_* variables are exported, so the tarball jobs
keep behaving as today until the release job injects them.

Refs: https://github.com/nodejs/node/issues/67140
Refs: https://github.com/nodejs/build/issues/3538
Refs: https://github.com/nodejs/build/issues/4545
Refs: https://github.com/nodejs/node/pull/66855
Assisted-by: Claude
Assisted-by: Codex
Signed-off-by: Ulises Gascon <ulisesgascongonzalez@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67143
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
2026-11-21 14:47:07 +01:00
Yuya Inoue 014c1e773b http2: release queued data memory on stream cancellation
Release the memory charged for queued outbound data when a stream is
canceled, so subsequent requests can reuse the session's memory budget.

Refs: https://github.com/nodejs/node/issues/66739
Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67113
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-21 14:47:07 +01:00
Lazizbek Ergashev 57b48eb8a8 src: fix build with --shared-brotli
Assisted-by: Claude Code
Signed-off-by: lazerg <lazerg2@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66895
Fixes: https://github.com/nodejs/node/issues/66894
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-21 14:47:06 +01:00
Antoine du Hamel dfdb0ef737 build: fix gtest integration
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66735
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-21 14:47:06 +01:00
Marcel 01bdf3f4cc test: fix on zfs build host
Signed-off-by: Marcel <me@m4rc3l.de>
PR-URL: https://github.com/nodejs/node/pull/67517
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-21 14:47:06 +01:00
Matteo Collina 472d501591 stream: keep async context of the pipeTo pump
The pipeTo() pump re-enters from the destination's ready hook, which
writableStreamUpdateBackpressure invokes synchronously, and from the
chunk steps of its read request. Both run in the async context of the
code that cleared the backpressure or enqueued the chunk, so the
source's pull() and the writes issued after a resumption observed that
context instead of the one of the pipeTo() call, as they did with the
promise-based pump. Capture the async context frame when the pipe starts
and run the pump in it.

Refs: https://github.com/nodejs/node/issues/66906
Refs: https://github.com/nodejs/node/pull/65138
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67054
Refs: https://github.com/nodejs/node/pull/67052
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-21 14:47:06 +01:00
npm CLI robot 2c9136b287 deps: upgrade npm to 11.21.3
PR-URL: https://github.com/nodejs/node/pull/67628
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-21 14:47:06 +01:00
Yao Zi dfe91b6642 build: do not include vendored simdutf with --shared-simdutf
Do not include the vendored simdutf when compiling merve if shared
simdutf is used to ensure the headers match the linked library.

Signed-off-by: Yao Zi <me@ziyao.cc>
PR-URL: https://github.com/nodejs/node/pull/67410
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-21 14:47:06 +01:00
Node.js GitHub Bot 43eb924bdf deps: update nghttp3 to 1.19.0
PR-URL: https://github.com/nodejs/node/pull/67333
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-11-21 14:47:06 +01:00
npm CLI robot 4c30b5f14e 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 14:47:06 +01:00
Brad Anderson 35ff55a14b 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 14:47:05 +01:00
Filip Skokan 5ba293f113 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 14:46:57 +01:00
Filip Skokan dbbfda1601 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-21 11:33:24 +01:00
Node.js GitHub Bot 357a0ed01b 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-21 11:33:24 +01:00
Node.js GitHub Bot 222866c49c 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-21 11:33:24 +01:00
Node.js GitHub Bot 58421971fa 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-21 11:33:24 +01:00
Yagiz Nizipli 3b93ac1746 crypto: skip clearing empty OpenSSL error queues
ClearErrorOnReturn calls ERR_clear_error() when it is created and
again when it goes out of scope. That function resets all 16 slots of
the thread's error queue, including two free() calls per slot, even
when the queue is empty, which is almost always the case. Check for a
queued error first, which costs a fraction of that.

ClearErrorOnReturn guards most crypto operations, including every
CryptoJob, so this applies to all of them.

Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
Assisted-by: Grok
PR-URL: https://github.com/nodejs/node/pull/67109
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-21 11:33:23 +01:00
Node.js GitHub Bot 7bcc992544 deps: update simdjson to 5.1.0
PR-URL: https://github.com/nodejs/node/pull/67172
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-21 11:33:23 +01:00
Node.js GitHub Bot 0b6907b3a8 deps: update zlib to 1.3.2.1-motley-9f9f52c
PR-URL: https://github.com/nodejs/node/pull/66989
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-11-21 11:33:23 +01:00
Node.js GitHub Bot 4451011240 deps: update googletest to cd8e73f067129f8489e35c7b51c7a68552b289d2
PR-URL: https://github.com/nodejs/node/pull/66814
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-21 11:33:23 +01:00
Filip Skokan 94f626c8aa tls: configure TLS 1.3 ciphers with BoringSSL
Translate cipher-suite names into protocol IDs for BoringSSL's TLS 1.3
configuration API. Handle duplicates and unknown names, reject nonempty
lists without a supported suite, and implement honorCipherOrder through
preference flags.

Cover suite restrictions, explicit preference ordering, legacy-only
lists, runtime defaults, and command-line overrides.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66922
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-21 11:33:23 +01:00
Node.js GitHub Bot 990f3639b0 deps: update simdjson to 5.0.5
PR-URL: https://github.com/nodejs/node/pull/66817
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-11-21 11:33:23 +01:00
Victor Gomesandinoway46 59d11e1207 deps: V8: backport 7d5eb1df2a72
Backport the Maglev HeapNumber materialization fix to V8 13.6.
Emit a captured HeapNumber with its map and constant numeric value,
using the existing deoptimizer to allocate a fresh box. Reserve a
nonduplicatable object ID for each box. Keep the literal-number helper
for fixed double arrays and captured-object numeric values. No virtual
object slot traversal changes or prerequisite commits are needed.
This mirrors the existing V8 13.6 Turbolev map/value materialization.

Original commit message:

    [maglev] Materialize a fresh HeapNumber per deoptimization

    This matches what Turbolev graph builder already does to Maglev.

    Fixed: 547819997
    Change-Id: Iafc1185ef96db8816db36b295a3a4b7e528f9863
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8255554
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Victor Gomes <victorgomes@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#109347}

Refs: https://github.com/v8/v8/commit/7d5eb1df2a721c8fe3aa03b999464c4b86242080
Refs: https://github.com/nodejs/node/issues/66457
Refs: https://www.cve.org/CVERecord?id=CVE-2026-85045
Co-authored-by: inoway46 <inoueyuya416@gmail.com>
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66567
2026-11-21 11:33:23 +01:00
Austin BurdineandAntoine du Hamel 730b8b63fd 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-19 16:44:48 +01:00
Lu Yahan b3c5918bfe deps: V8: cherry-pick ec2f506f97df
Original commit message:

    [riscv][sandbox] Make sure we have a valid dispatch handle in optimized code

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

Refs: https://github.com/v8/v8/commit/ec2f506f97dfbb5fa19e4fe9103965a3c94690af
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67430
2026-11-19 16:44:47 +01:00
Marco Ippolito 77623834e8 doc: update node-config-schema.json
Regenerate the schema with tools/doc/generate-json-schema.mjs. It had
fallen out of date because test-config-json-schema is skipped unless
Node.js is built with QUIC, so it does not run in CI.

Assisted-by: claude:opus-5.5
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Rafael Gonzaga a429fd0c97 child_process: propagate config-file permission flags to children
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Marco Ippolito 53ae9e58be src: fix config file handling
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Marco Ippolito 7fb54df865 src: mark config file as stable
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Marco Ippolito e3a4580622 doc: mark config-file as release candidate
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Marco Ippolito 0c6040b5a4 src: support multiple versions in node.config.json
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Marco Ippolito 73b6f41ab5 src: implicitly enable namespace in config
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Marco Ippolito dc17b3ffb2 src: add permission flag to config file
PR-URL: https://github.com/nodejs/node/pull/66830
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-19 16:44:47 +01:00
Antoine du Hamel 58de029d47 build: silence nullability-completeness warnings on macOS
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67460
Reviewed-By: Tierney Cyren <hello@bnb.im>
2026-11-19 16:18:55 +01:00
Michaël ZassoandYagiz Nizipli 6f3da31677 build: update macOS runner and Xcode
Xcode 16.4 will be required for Node.js 25.
macOS 15 is required for Xcode 16.4.

Refs: https://github.com/nodejs/node/issues/58069
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/59238
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2026-11-19 16:17:03 +01:00
Stewart X Addison cf5baea512 doc: promote Alpine Linux to tier 2 support
kernel >= 6.12, musl >= 1.2.5
updated to align with lowest supported version Alpine Linux 3.21
see https://alpinelinux.org/releases/
see https://alpinelinux.org/posts/Alpine-3.21.0-released.html

Alpine 3.22 listed as example version

Signed-off-by: Stewart X Addison <sxa@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/63737
Backport-PR-URL: https://github.com/nodejs/node/pull/66588
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-14 15:13:52 +01:00
Matteo Collina 3a7e1ad1e0 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-13 17:02:18 +01:00
Matteo Collina 1ea57dbce0 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-13 17:02:18 +01:00
Matteo Collina 5ac48a96db 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-13 17:02:18 +01:00
Qingyu Wang 2b50db1364 stream: fix pipeTo assert when writer is released during microtask
pipeTo defers each slow-path write to a microtask so it does not run
synchronously during enqueue(). A race allows the pipe to shut down and
release its writer after the write is scheduled but before it runs. The
deferred write then hits an ERR_INTERNAL_ASSERTION because
writer[[stream]] is undefined.

Skip the deferred write when shutdown has already started.

Fixes: https://github.com/nodejs/node/issues/63732
Signed-off-by: Qingyu Wang <wangqingyu.c0l1n@bytedance.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/63733
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-13 17:02:18 +01:00
Matteo Collina 5d541dcd26 stream: reject writes during WritableStream close
WritableStreamDefaultControllerProcessClose clears the controller
algorithms while the stream is still 'writable', before the sink close
settles. A write in that window, such as writer.write() after
writer.close() while the sink's close() or a TransformStream's flush()
is pending, reached the cleared size algorithm and failed an internal
assertion instead of being rejected as closing. Accept that state in
writableStreamDefaultControllerGetChunkSize so the write is rejected
with a TypeError, as it is once the stream has closed.

Refs: https://github.com/nodejs/node/issues/57272
Refs: https://github.com/whatwg/streams/issues/1341
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67058
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-13 17:02:18 +01:00
Matteo Collina ffddf27ec1 stream: keep async context of fromWeb writes
Writable.fromWeb() and Duplex.fromWeb() dispatch writes to the
WritableStream directly and complete them through a shared write
tracker. A write issued before the WritableStream had started was
queued and processed from its start step, so the sink ran in the async
context of the code that created the WritableStream, and the tracker
invoked the Node.js write callback synchronously from whatever context
completed the sink write, so the writes and final() it released ran
there too. The promise-based adapter waited for writer.ready and
received the result through a reaction, both in the context of the
Node.js write.

Dispatch writes issued before the start from a writer.ready reaction,
failing them if the stream was closed or errored meanwhile, and deliver
the write callback in the context of the Node.js write, from a reaction
when it completes in another context.

Refs: https://github.com/nodejs/node/issues/66906
Refs: https://github.com/nodejs/node/pull/65548
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67055
Refs: https://github.com/nodejs/node/pull/67052
Refs: https://github.com/nodejs/node/pull/67054
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-11-13 17:02:18 +01:00
Matteo Collina d5fa3be434 stream: keep async context of pipeTo watchers
The ClosedPromiseHook records that pipeTo() and tee() install as the
[[closedPromise]] of their reader and writer enqueued the watcher from
whoever settled the record. The source-closed, source-errored and
dest-errored steps of pipeTo() therefore ran in the async context of
the code that closed or errored the stream, so the destination's
close() and abort() and the source's cancel() observed the wrong
AsyncLocalStorage store. Capture the async context frame when the
hook is installed and register the reaction in it, as the spec's
promise reaction would.

Add a test that records the context each underlying source, sink and
transformer callback observes across readable, writable, transform,
pipe and tee scenarios, so scheduling shortcuts that drop the context
are caught.

Refs: https://github.com/nodejs/node/issues/66906
Refs: https://github.com/nodejs/node/pull/66424
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67052
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-13 17:02:17 +01:00
Matteo CollinaandClaude Opus 5.5 743ac944f9 test: keep objects alive in finalization fixtures
process.finalization only holds weak references to registered objects.
In unregister-function.mjs and finalization-cleanup.mjs the registered
objects were not captured by any closure, so a GC before exit could
collect them, skipping their exit callbacks and failing the assertions.
Reference them from the exit listeners so they stay reachable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DQrzezHzwzfCYeh2cYm2U
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66869
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-13 17:02:17 +01:00
Matteo Collina c3fd64dc66 test_runner: use AsyncLocalStorage instead of async_hooks
Track the test that owns the current async context with an
AsyncLocalStorage instead of a createHook() init/destroy map.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66795
Refs: https://github.com/nodejs/node/pull/61030
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-13 17:02:17 +01:00