Add raw key format support (raw-public, raw-private, raw-seed) to
KeyObject.prototype.export(), crypto.createPrivateKey(),
and crypto.createPublicKey() for applicable asymmetric keys (EC,
CFRG curves, ML-DSA, ML-KEM, and SLH-DSA).
Also wire these to the Web Cryptography APIs and remove the unnecessary
KeyExportJob. The KeyExportJob classes were removed because the export
operations they performed are not computationally expensive. They're
just serialization of already-available key data (SPKI, PKCS8, raw
bytes). Running them as async CryptoJobs on the libuv thread pool added
unnecessary overhead and complexity for operations that complete
instantly.
PR-URL: https://github.com/nodejs/node/pull/62240
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This is a security release.
Notable changes:
crypto:
* (CVE-2026-21713) use timing-safe comparison in Web Cryptography HMAC
deps:
* update undici to v6.24.1
* (CVE-2026-21717) fix array index hash collision
http:
* (CVE-2026-21710) use null prototype for headersDistinct/trailersDistinct
permission:
* (CVE-2026-21716) include permission check on lib/fs/promises
* (CVE-2026-21715) add permission check to realpath.native
src:
* (CVE-2026-21714) handle NGHTTP2_ERR_FLOW_CONTROL error code
tls:
* (CVE-2026-21637) wrap SNICallback invocation in try/catch
PR-URL: https://github.com/nodejs-private/node-private/pull/842
This is a security release.
Notable changes:
build,deps,test:
* (CVE-2026-21717) test array index hash collision
crypto:
* (CVE-2026-21713) use timing-safe comparison in Web Cryptography HMAC and KMAC
http:
* (CVE-2026-21710) use null prototype for headersDistinct/trailersDistinct
permission:
* (CVE-2026-21711) include permission check to pipe_wrap.cc
* (CVE-2026-21716) include permission check on lib/fs/promises
* (CVE-2026-21715) add permission check to realpath.native
src:
* (CVE-2026-21714) handle NGHTTP2_ERR_FLOW_CONTROL error code
* (CVE-2026-21712) handle url crash on different url formats
tls:
* (CVE-2026-21637) wrap SNICallback invocation in try/catch
PR-URL: https://github.com/nodejs-private/node-private/pull/843
This is a security release.
Notable changes:
build,deps,test:
* (CVE-2026-21717) test array index hash collision
crypto:
* (CVE-2026-21713) use timing-safe comparison in Web Cryptography HMAC and KMAC
http:
* (CVE-2026-21710) use null prototype for headersDistinct/trailersDistinct
permission:
* (CVE-2026-21716) include permission check on lib/fs/promises
* (CVE-2026-21715) add permission check to realpath.native
src:
* (CVE-2026-21714) handle NGHTTP2_ERR_FLOW_CONTROL error code
* (CVE-2026-21712) handle url crash on different url formats
tls:
* (CVE-2026-21637) wrap SNICallback invocation in try/catch
PR-URL: https://github.com/nodejs-private/node-private/pull/837
This is a security release.
Notable changes:
build,test,deps:
* (CVE-2026-21717) test array index hash collision
crypto:
* (CVE-2026-21713) use timing-safe comparison in Web Cryptography HMAC
http:
* (CVE-2026-21710) use null prototype for headersDistinct/trailersDistinct
permission:
* (CVE-2026-21716) include permission check on lib/fs/promises
* (CVE-2026-21715) add permission check to realpath.native
src:
* (CVE-2026-21714) handle NGHTTP2_ERR_FLOW_CONTROL error code
tls:
* (CVE-2026-21637) wrap SNICallback invocation in try/catch
PR-URL: https://github.com/nodejs-private/node-private/pull/844
Implement QuotaExceededError as a DOMException-derived interface per the
WebIDL specification update.
QuotaExceededError is now a proper constructor exposed as a global
[Exposed=*] interface that extends DOMException with optional `quota`
and `requested` attributes (both nullable doubles, defaulting to null).
The constructor validates that quota and requested are finite,
non-negative, and that requested is not less than quota when both are
provided.
QuotaExceededError is [Serializable] and supports structuredClone,
preserving the quota and requested values across the serialization
boundary.
Callers updated:
- crypto.getRandomValues() now throws a QuotaExceededError instance
- WebStorage (C++) now constructs QuotaExceededError directly
Refs: https://redirect.github.com/whatwg/webidl/pull/1465
Fixes: https://github.com/nodejs/node/issues/58987
PR-URL: https://github.com/nodejs/node/pull/62293
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Extends the Wasm ESM Integration for importing WebAssembly
modules in either the source phase or instance phase to support
importing static JS string constants from the special
import name `wasm:js/string-constants`.
PR-URL: https://github.com/nodejs/node/pull/62198
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Configure OpenSSL provider parameters to prefer seed-only format
when exporting ML-KEM and ML-DSA private keys that contain a seed.
Keys without a seed continue to use the private-only format.
PR-URL: https://github.com/nodejs/node/pull/62178
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Whether or not an exception should be handled when it
was thrown in the REPL's context but the REPL is already
closed is something that will depend on the details of
the specific REPL instance's use case.
Adding this option lets the REPL's creator control the
details of this behavior.
This resolves a TODO recently added in bd3cba5633.
PR-URL: https://github.com/nodejs/node/pull/62188
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
The initial support for ESM entrypoint in SEA didn't support
code cache. This patch implements that by following a path
similar to how code cache in CJS SEA entrypoint is supported:
at build time we generate the code cache from C++ and put it
into the sea blob, and at runtime we consume it via a special
case in compilation routines - for CJS this was
CompileFunctionForCJSLoader, in the case of SourceTextModule,
it's in Module::New.
PR-URL: https://github.com/nodejs/node/pull/62158
Refs: https://github.com/nodejs/node/pull/61813
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Replace the domain-based error handling with AsyncLocalStorage and
setUncaughtExceptionCaptureCallback. This removes the REPL's dependency
on the deprecated domain module while preserving all existing behavior:
- Synchronous errors during eval are caught and displayed
- Async errors (setTimeout, promises, etc.) are caught via the
uncaught exception capture callback
- Top-level await errors are caught and displayed
- The REPL continues operating after errors
- Multiple REPL instances can coexist with errors routed correctly
Changes:
- Use AsyncLocalStorage to track which REPL instance owns an async
context, replacing domain's automatic async tracking
- Add setupExceptionCapture() to install
setUncaughtExceptionCaptureCallback for catching async errors and
routing them to the correct REPL
- Extract error handling logic into REPLServer.prototype._handleError()
- Wrap eval execution in replContext.run() for async context tracking
- Update newListener protection to check AsyncLocalStorage context
- Throw ERR_INVALID_ARG_VALUE if options.domain is passed
PR-URL: https://github.com/nodejs/node/pull/61227
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>