Commit Graph
47645 Commits
Author SHA1 Message Date
Matteo Collina 935918e342 tls: reject non-canonical IP addresses
TLS identity checks normalized non-canonical numeric hosts before
matching certificates. Platform resolvers can interpret the original
host as a different address.

Reject hosts that become IP addresses only after domainToASCII()
normalization.

Assisted-by: Pi
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/982
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
CVE-ID: CVE-2026-106069
2026-10-19 23:59:08 +02:00
James M Snell de49c913f2 tls: fix ip normalization regression
The regression is a low-severity bug that's not easy to
exploit. Basically it just means the hostname check can
be bypassed.

Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/985
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
CVE-ID: CVE-2026-105483
2026-10-19 23:59:07 +02:00
James M Snell 843a1627dc dns: validate resolve inputs for null bytes
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
PR-URL: https://github.com/nodejs-private/node-private/pull/984
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
CVE-ID: CVE-2026-105482
2026-10-19 23:59:07 +02:00
James M Snell 96c3ccb1fc http: ensure agent data guard works without I/O
Before a kept-alive socket is given to a request, now ask the OS
whether anything is waiting to be read on it. If there is, the
Agent destroys the socket and uses another one or opens a new
connection. The check doesn't consume any bytes.

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
PR-URL: https://github.com/nodejs-private/node-private/pull/983
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
CVE-ID: CVE-2026-105481
2026-10-19 23:55:58 +02:00
fca511adc5 deps: V8: backport 93cd21e8254b
Original commit message:

    skip fast transition path for escaped keys

    JSDataObjectBuilder's fast transition path previously compared undecoded
    source bytes of an escaped key against existing transitions.
    GetKeyChars() returned undecoded source bytes sliced using the decoded
    length, so escaped keys could incorrectly match persisted transitions
    and corrupt the keys of subsequent JSON.parse() calls.

    This patch fixes it by skipping the fast path when the key has escape
    characters.

    Co-Authored-By: 3zrvvv@gmail.com
    Bug: 521080746
    Change-Id: I77720cc34758180224ca8e0e5de0af48556ed013
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8412610
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#109925}

Refs: https://github.com/v8/v8/commit/93cd21e8254b65c15ff131b2dcadf19beadb559d
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/1008
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-19 23:55:01 +02:00
Filip SkokanandMatteo Collina 4b3c9bbf9f crypto: harden X.509 conversion and formatting
Check X.509 ASN.1, BIO, time, OID, and DER conversion results.
Preserve invalid-time diagnostics, reject incomplete BIO writes, format
RSA exponents atomically, and avoid truncating long object identifiers.

Preserve valid siblings in legacy name objects by omitting individual
non-text AttributeValues. Continue treating structural failures and
failed conversion of supported string types as conversion failures.
Reject empty or malformed SAN and AIA extensions, and prevent TLS
hostname checks from falling back to commonName after a malformed SAN.

Guard missing public keys and non-NIST curve names. Scope fallible
backend probes without consuming callback errors, parse checkIP()
inputs to exact address bytes, and preserve unrelated backend errors.

Refs: https://hackerone.com/reports/3910015
Refs: https://hackerone.com/reports/3824331
Refs: https://hackerone.com/reports/3944830
Refs: https://hackerone.com/reports/3944847
Assisted-by: Codex
Co-authored-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/1007
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-19 23:53:36 +02:00
Node.js GitHub Bot 9243b105b6 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-19 23:47:07 +02:00
Node.js GitHub Bot 18711c7567 deps: update timezone to 2026e
PR-URL: https://github.com/nodejs/node/pull/66419
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-10-19 23:47:06 +02:00
Node.js GitHub Bot fa77cfb1ad deps: update timezone to 2026d
PR-URL: https://github.com/nodejs/node/pull/66333
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-19 23:47:06 +02:00
Node.js GitHub Bot b84f9f186b deps: update archs files for openssl-3.5.9
PR-URL: https://github.com/nodejs/node/pull/66396
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2026-10-19 23:47:06 +02:00
Node.js GitHub Bot ff0664c3ba deps: upgrade openssl sources to openssl-3.5.9
PR-URL: https://github.com/nodejs/node/pull/66396
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2026-10-19 23:47:05 +02:00
Node.js GitHub Bot 1d4c89ef87 deps: update undici to 7.30.1
PR-URL: https://github.com/nodejs/node/pull/66764
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-10-19 23:42:51 +02:00
Richard Lau 0d10bfe3cb Working on v24.22.1
PR-URL: https://github.com/nodejs/node/pull/66667
Signed-off-by: Richard Lau <richard.lau@ibm.com>
2026-10-14 15:04:38 +00:00
Node.js GitHub Bot f14cd3aa7b 2026-10-14, Version 24.22.0 'Krypton' (LTS)
Notable changes:

crypto:
  * (SEMVER-MINOR) add crypto.parsePKCS12() (Brian Muenzenmeyer) https://github.com/nodejs/node/pull/65627
  * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) https://github.com/nodejs/node/pull/65553
  * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) https://github.com/nodejs/node/pull/65484
  * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) https://github.com/nodejs/node/pull/65484
  * (SEMVER-MINOR) enable SIV and GCM-SIV modes in Cipher/Decipher APIs (Filip Skokan) https://github.com/nodejs/node/pull/63411
doc:
  * add araujogui to collaborators (Guilherme Araújo) https://github.com/nodejs/node/pull/66090
  * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) https://github.com/nodejs/node/pull/65593
net:
  * (SEMVER-MINOR) support sending net.BoundSocket to threads and child processes (Guy Bedford) https://github.com/nodejs/node/pull/64725
perf_hooks:
  * (SEMVER-MINOR) implement SlidingWindowHistogram (James M Snell) https://github.com/nodejs/node/pull/65825
  * (SEMVER-MINOR) implement qrde analysis support in Histogram (James M Snell) https://github.com/nodejs/node/pull/65806
  * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) https://github.com/nodejs/node/pull/65606
  * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) https://github.com/nodejs/node/pull/65434
sqlite:
  * (SEMVER-MINOR) add StatementSync.prototype.close() (Guilherme Araújo) https://github.com/nodejs/node/pull/64232
  * (SEMVER-MINOR) add StatementSync.prototype[Symbol.dispose]() (Guilherme Araújo) https://github.com/nodejs/node/pull/64232
src,lib:
  * (SEMVER-MINOR) add util.markPromiseAsHandled (James M Snell) https://github.com/nodejs/node/pull/65805
util:
  * (SEMVER-MINOR) implement util.throttle (James M Snell) https://github.com/nodejs/node/pull/65899
  * (SEMVER-MINOR) implement debounce (James M Snell) https://github.com/nodejs/node/pull/65899

PR-URL: https://github.com/nodejs/node/pull/66667
v24.22.0
2026-10-13 16:09:48 +02:00
Gundepalli Sravani b8db0045ef deps: V8: cherry-pick ea9c016f26ad
Original commit message:

    AIX: Fix race condition in DecommitPages

    The current implementation of DecommitPages could lead to a race
    condition where another thread maps the same region of memory right after we unmap it.

    This is currently causing test failures on Node.js:
    https://github.com/nodejs/node/issues/62647

    As a workaround we avoid unmapping the address space and instead
    mark the region as inaccessible using mprotect. We originally
    considered using madvise to release physical memory, but it is a
    no-op on AIX and was omitted from this implementation.
    IT:105

    Change-Id: I8271a562be2e7ebcb685a2dd3b7425a38bebe1c9
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8193436
    Reviewed-by: Anton Bikineev <bikineev@chromium.org>
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Reviewed-by: Milad Farazmand <mfarazma@ibm.com>
    Cr-Commit-Position: refs/heads/main@{#109206}

Refs: https://github.com/v8/v8/commit/ea9c016f26ad274ab86595e8d3fc8712378706dd
Signed-off-by: Richard Lau <richard.lau@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/66570
Refs: https://github.com/nodejs/node/issues/62647
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-11 00:27:20 +02:00
Jakob Linkeandinoway46 ba09b53487 deps: V8: backport c3553509f460
Original commit message:

    [compiler] Thread-safe IsArrayOrObjectPrototype

    Bug: 467311868
    Change-Id: I574aa62d859030545e6a52d693a61e570381e557
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7460949
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Jakob Linke <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#104707}

Refs: https://github.com/v8/v8/commit/c3553509f460b104cb8d4faf610d229a2d033f7b
Co-authored-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66089
Fixes: https://github.com/nodejs/node/issues/66053
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-10 22:05:46 +02:00
Toon Verwaestandinoway46 9ce8ef405b deps: V8: backport 8901c793e439
Original commit message:

    [compiler] Stop collecting array and object prototypes

    We can check in O(1) whether an object is either Object.prototype or
    Array.prototype by directly comparing it with the objects, so there's
    no need to collect them.

    Change-Id: Iadedf8b05cae3d67191fb4836c186620dc009118
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6487694
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Auto-Submit: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#99894}

Refs: https://github.com/v8/v8/commit/8901c793e4392dfea261bcbf9c679e2978847d4d
Co-authored-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66089
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-10 22:05:02 +02:00
Shelley Vohr 83b3431c25 src: detach cppgc wrappers from their Realm before it is freed
`Realm::RunCleanup()` finalizes the cppgc-managed wrappers it tracks
so that none of them touches the Realm once it is gone, but it reaches
them through weak persistents, and the GC clears those as soon as it
finds a wrapper dead. With lazy and concurrent sweeping the destructor
can run much later, so a wrapper collected shortly before
`FreeEnvironment()` and swept after it was skipped by the cleanup and
kept its `realm_`: `~CppgcMixin()` then wrote
`should_purge_empty_cppgc_wrappers_` into the freed Realm, and a
subclass destructor calling `Finalize()` as documented would have
called `Clean()` with a dangling Realm. A Worker that compiles a few
`vm.Script`s, gets a full GC from external memory pressure and calls
`process.exit()` is enough to hit the first case.

Move the Realm pointer into the list node, which the wrapper now owns
and deletes in its destructor. `CppgcWrapperList::Cleanup()` unlinks
every node, finalizing the wrappers that are still alive and clearing
the Realm pointer for the collected ones, which only their own
destructor may still touch. `Realm::PendingCleanup()` accounts for the
list so it is always drained. The purge flag, its GC epilogue callback
and `PurgeEmpty()` are no longer needed, and removing them also stops
the list nodes of wrappers that are alive at `FreeEnvironment()` from
leaking.

Refs: https://github.com/nodejs/node/pull/56534
Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65778
Backport-PR-URL: https://github.com/nodejs/node/pull/66168
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-07 10:36:48 +02:00
James Ross 13ed7e35e7 src: list scripts when --run has no command
Signed-off-by: James Ross <james@jross.me>
PR-URL: https://github.com/nodejs/node/pull/64606
Backport-PR-URL: https://github.com/nodejs/node/pull/66133
Fixes: https://github.com/nodejs/node/issues/64870
Refs: https://github.com/nodejs/node/pull/64606
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-07 10:36:06 +02:00
Piotr Kubaj 249e9a16dd build,src: gate jspi flag on V8_ENABLE_WEBASSEMBLY
Since d937c8c6cd ("wasm: enable JSPI") ProcessGlobalArgsInternal()
unconditionally appends --experimental-wasm-jspi to the V8 argument
list. V8 only defines the experimental_wasm_* flags when it is built
with V8_ENABLE_WEBASSEMBLY, and configure --v8-lite-mode sets
v8_enable_webassembly=0. V8::SetFlagsFromCommandLine() is called with
remove_flags=true, which silently leaves unrecognized flags in argv, so
node reports "bad option: --experimental-wasm-jspi" and exits with
kInvalidCommandLineArgument. The first binary to run that code is
node_mksnapshot, so every --v8-lite-mode build has failed since
v24.20.0:

  bad option: --experimental-wasm-jspi
  node_mksnapshot failed with exit code 9

Forward v8_enable_webassembly to all targets as V8_ENABLE_WEBASSEMBLY,
the same way common.gypi already forwards the other V8 build flags, and
only push the JSPI flag when WebAssembly is compiled in.

Refs: https://github.com/nodejs/node/pull/59941
Assisted-by: claude:fable-5.1
Signed-off-by: Piotr Kubaj <pkubaj@FreeBSD.org>
PR-URL: https://github.com/nodejs/node/pull/66082
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2026-10-06 15:28:40 +02:00
Shelley Vohr 6dab5412cf test: skip RSA-PSS keygen deprecation tests with BoringSSL
test-crypto-keygen-deprecation and
test-crypto-keygen-duplicate-deprecated-option generate rsa-pss key
pairs, which BoringSSL does not support. The other rsa-pss keygen tests
skip there since https://github.com/nodejs/node/pull/62883, but these
two only exist on v24.x (https://github.com/nodejs/node/pull/58706
removed them from main earlier), so its backport could not cover them.

Refs: https://github.com/nodejs/node/pull/62883
Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65808
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-10-06 14:53:55 +02:00
Ruan Gustavo fb0d0ca289 deps: V8: backport 0b94a9fd23ba
Original commit message:

    [leaptiering] Fix BaselineOutOfLinePrologue builtin

    ... which tried to preserve kJavaScriptCallDispatchHandleRegister even
    on configurations where it's not used which resulted in a random value
    on the stack discoverable by GC.
    This issue triggered only on non-sandbox configuration with enabled
    leaptiering.

    Drive-by: fix MacroAssembler::GenerateTailCallToReturnedCode() on riscv
    port which wasn't preserving dispatch handle as all the other ports do.

    Bug: 42204201
    Fixed: 413769394

    Change-Id: If146b0b7a6cf972ed5a881142f40980774f19cba
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6587010
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Reviewed-by: Olivier Flückiger <olivf@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#100512}

Node.js 24 builds V8 with leaptiering enabled and the sandbox disabled,
so V8_JS_LINKAGE_INCLUDES_DISPATCH_HANDLE is not defined and the JS
calling convention does not carry the dispatch handle register (x4 on
arm64). BaselineOutOfLinePrologue and GenerateTailCallToReturnedCode
still pushed that register as a tagged slot of an INTERNAL frame, so
whatever value the caller left there is dereferenced by
ClearStaleLeftTrimmedPointerVisitor during mark-compact root scanning
and crashes the process with SIGSEGV (seen as jest workers dying).

Refs: https://github.com/v8/v8/commit/0b94a9fd23ba5f59b3f675fb04d60a9b0102e27d
Fixes: https://github.com/nodejs/node/issues/62393
PR-URL: https://github.com/nodejs/node/pull/65753
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-09-29 12:01:52 +00:00
Antoine du Hamel 13987f4418 crypto: remove redundent std::move call
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66111
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:13 +02:00
Filip Skokan 95d9a25b61 test: consolidate crypto provider cache coverage
Exercise getCiphers(), getHashes(), getMacs() and getCurves() through
one shared cache/FIPS driver and one snapshot fixture. Keep defensive
copies, generation changes, rejected and idempotent toggles, and
cross-worker invalidation consistent across the lists.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66108
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:12 +02:00
Filip Skokan ef957ac85f crypto: skip private RSA parameters in key details
Retrieving asymmetricKeyDetails only needs the modulus, public exponent,
and RSA-PSS restrictions. Add a public-only Rsa view so provider-backed
keys do not also extract private components or probe additional primes.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66108
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:11 +02:00
Filip Skokan 8feccc5e22 crypto: use provider EC group names
Pass group names through EC key generation and report provider names
in key details without requiring an OpenSSL NID. Preserve established
curve aliases and synchronous invalid-curve errors.

Filter built-in curves through EC parameter generation and refresh
getCurves() results when FIPS properties change.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66108
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:10 +02:00
Filip Skokan 764e0d1120 crypto: fetch ciphers for private-key encoding
Resolve provider ciphers before serializing private keys and retain the
fetched implementation across encoding configuration copies and async
key generation. Keep format-specific restrictions in the serializers.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66108
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:09 +02:00
Filip Skokan 50ffed1979 crypto: decode PKCS#1 keys through providers
Import RSA public keys through OSSL_DECODER on OpenSSL 3 so the
resulting keys stay provider-backed. Preserve the PKCS#1 input structure
and the ASN.1 encodings accepted by the legacy decoder.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66108
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:08 +02:00
Filip Skokan 56c16b2fd6 crypto: derive keys through EVP_KDF
Use one owning KDF interface for HKDF expansion, PBKDF2 and scrypt,
sharing provider setup with Argon2.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66108
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:07 +02:00
Filip Skokan 612db6d5b2 test: deflake user timing WPT assertions
The fixed 20 ms tolerance in mark.any.js can fail when execution pauses
between creating a mark and reading the clock. Adapt the test in memory
to check the mark timestamp against readings before and after mark().
Keep the vendored fixture and subtest names unchanged.

Apply script modifiers to worker entry scripts as well so the check
covers both WPT globals, and remove the suite-wide flaky expectation.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66036
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Fixes: https://github.com/nodejs/node/issues/40449
Refs: https://github.com/nodejs/node/pull/41203
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:06 +02:00
Filip Skokan a4effe6809 crypto: use names for asymmetric key algorithms
Provider-backed keys can have no numeric OpenSSL ID. Identify and
construct asymmetric keys by algorithm name, replacing the custom PQC
name-to-NID substitution with provider-aware matching in ncrypto.

Centralize known algorithm names, public key-type names, capabilities,
and backend compatibility in ncrypto. Use named key generation jobs and
remove asymmetric EVP_PKEY constants from the internal JavaScript
binding.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/65966
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:05 +02:00
Brian MuenzenmeyerandFilip Skokan ddbf974b47 crypto: add crypto.parsePKCS12()
Return the private key, end-entity certificate, and any other
non-matching certificates from a PKCS#12 (.p12/.pfx) bundle as a
KeyObject and X509Certificate instances.

Node.js already parses PKCS#12 in SecureContext::LoadPKCS12, which backs
tls's `pfx` option, but the results are consumed directly into an
SSL_CTX and never reach JavaScript. Callers who need the key or the
certificates for anything other than an immediate TLS connection have to
shell out to `openssl pkcs12` or take a userland dependency.
SecureContext::LoadPKCS12 now uses this same parsing logic.

The binding wraps d2i_PKCS12_bio() and PKCS12_parse() and follows their
semantics, matching the existing TLS path: the first private key is
returned, the end-entity certificate is the one associated with that
key, and any remaining certificates are returned through
`additionalCertificates`. A bundle containing no private key reports
`certificate` as null and returns its certificates through
`additionalCertificates`.

Absent and empty passphrases are kept distinct, since OpenSSL treats
them differently. Bundles that require OpenSSL's legacy provider throw
ERR_CRYPTO_UNSUPPORTED_OPERATION, reusing the error added for the TLS
path.

Signed-off-by: bmuenzenmeyer <brian.muenzenmeyer@gmail.com>
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65627
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:04 +02:00
Filip Skokan e7ed4361d6 doc,test: account for OpenSSL 4.1 behaviours
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65956
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Refs: https://openssl-library.org/post/2026-09-09-openssl-4.1-alpha/
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:03 +02:00
Filip Skokan cb93d40549 test,benchmark: use OpenSSL feature helpers
Add isBoringSSL to the test crypto helpers and use it in tests and
benchmarks. Replace hasOpenSSL3 call sites with hasOpenSSL(3).

Assisted-by: Codex
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65762
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:02 +02:00
Filip Skokan 8e631aa48f crypto: add Hybrid KEMs to Web Cryptography
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65759
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:48:01 +02:00
Filip Skokan 61a73d31eb test: fix RSA/DSA wrong-passphrase flake
Re-encrypting keys on each FIPS test run can produce ciphertext that
decrypts with valid padding under the wrong password, causing a decoder
error instead of the expected bad decrypt.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/65983
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Refs: https://github.com/nodejs/node/actions/runs/34595689099/job/103251404626?pr=65980
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:59 +02:00
Filip Skokan d9f4a3ee3e test: reuse fixed primes in DH tests
Use the modp14 prime instead of generating fresh parameters for tests
of constructors, key setters, and memory retention. Keep generic
DiffieHellman instances and the existing setter and leak assertions.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/65980
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:58 +02:00
Filip Skokan a0fd0a8bd6 test: use named parameters in DH stress test
Named modp14 parameters avoid generating and repeatedly validating a
custom prime. Keep the existing exchange counts and FIPS rejection
assertion. The separate deterministic padding test continues to cover
imported prime parameters.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/65980
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:57 +02:00
Filip Skokan 5c51129e16 crypto: optimize private EC JWK import
Avoid creating temporary EVP objects and repeating key validation while
retaining the private scalar range and public/private consistency
checks.

Assisted-by: GitHub Copilot
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65908
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:56 +02:00
Filip Skokan 3f0b6d3308 lib: avoid repeat internal receiver checks
Let internal helpers access the private cache directly to avoid
repeating receiver checks.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65910
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Refs: https://github.com/nodejs/node/pull/65846
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:55 +02:00
Filip Skokan 0039479b4a lib: fix shared buffer growability validation
Use the intrinsic growable getter instead of buffer.growable so
shadowed properties cannot bypass validation or reject fixed buffers.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: GitHub Copilot
PR-URL: https://github.com/nodejs/node/pull/65845
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:54 +02:00
Filip Skokan e7907130ae lib: use Web IDL interface brand checks
Use explicit brand predicates for interface conversion instead of
prototype ancestry. Update CryptoKey and AbortSignal together with the
shared converter contract.

Read internal AbortSignal state during composition. Preserve genuine
signals after prototype changes without invoking shadowed getters.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: GitHub Copilot
PR-URL: https://github.com/nodejs/node/pull/65846
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:53 +02:00
Filip Skokan c2ec40c2d7 crypto: disable non-FIPS WebCrypto paths in FIPS mode
Hide TurboSHAKE and KangarooTwelve when FIPS is enabled. Reject cSHAKE
and KMAC parameters that require implementations outside the OpenSSL
provider, while keeping provider-backed paths available.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65172
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:51 +02:00
Filip Skokan 810a6b00ee test: update tests to run with OpenSSL >= 3.0 FIPS mode
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64960
Backport-PR-URL: https://github.com/nodejs/node/pull/66233
Fixes: https://github.com/nodejs/node/issues/48379
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-09-25 18:47:46 +02:00
Richard Lau c555ba0aeb tools: update tools/v8 for Python 3.13
The `pipes` module was removed in Python 3.13 after being deprecated in
Python 3.11.

Also remove Python 2 compatibility shim as scripts require Python 3.

Assisted-by: IBM Bob
Signed-off-by: Richard Lau <richard.lau@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/66109
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-09-25 18:01:55 +02:00
Filip Skokan e198aa0f79 crypto: read RSA-PSS restrictions from provider
Query salt length and digest restrictions instead of serializing the key
to SPKI and parsing its algorithm identifier. A readable salt length
distinguishes restricted keys, including empty parameter sequences, from
unrestricted keys.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66108
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-09-25 18:01:55 +02:00
dependabot[bot] aafff27ebe tools: bump eslint-plugin-jsdoc in /tools/eslint in the eslint group
Bumps the eslint group in /tools/eslint with 1 update: [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc).

Updates `eslint-plugin-jsdoc` from 64.3.9 to 64.3.10
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v64.3.9...v64.3.10)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-version: 64.3.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/66102
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-09-25 18:01:55 +02:00
Shelley Vohr ebc028d75d trace_events: fix abort when Node.js does not own the V8 platform
Requiring `node:trace_events` and calling `createTracing()` aborted
the process, and `getEnabledCategories()` dereferenced a null pointer,
when Node.js runs on an embedder's own platform
(`kNoInitializeNodeV8Platform`): no `tracing::Agent` exists then, and
`lib/trace_events.js` only checked the compile-time `hasTracing` flag
and `ownsProcessState` before handing the null agent to the binding.

Have the binding report whether an agent exists and throw the existing
`ERR_TRACE_EVENTS_UNAVAILABLE` when it does not, as for a
`--without-v8-platform` build.

Refs: https://github.com/nodejs/node/pull/19803
Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65954
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-09-25 18:01:55 +02:00
Antoine du Hamel dc6b9ba5b2 test: deflake test-run-watch-cwd-isolation-none-*
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66035
Refs: https://github.com/nodejs/node/issues/66056
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-09-25 18:01:54 +02:00
Guilherme Araújo d11c65d2f2 doc: add araujogui to collaborators
Fixes: https://github.com/nodejs/node/issues/65585
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66090
Reviewed-By: Ruy Adorno <ruy@vlt.sh>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-09-25 18:01:54 +02:00