Commit Graph
49437 Commits
Author SHA1 Message Date
Filip Skokan dc6b82046c crypto: remove the FIPS provider name check
FIPS-capable providers can use names other than fips. Remove the
named-provider lookup and explicit self-test from the startup flags,
leaving algorithm availability checks to each operation.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67358
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-11 10:56:08 +00:00
Filip Skokan 2336a1f005 crypto: make X.509 inspection guards explicit
Require a supported backend when selecting the BIT STRING length
capability. Reject other backends at compile time, matching the
surrounding checks used to catch unsupported OpenSSL backports.

Assisted-by: Codex
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67245
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-11 10:46:22 +00:00
Filip Skokan 5498ee6eb5 crypto: add X.509 generation with CSR support
Expose callback-based generateX509Certificate() and synchronous
generateX509CertificateSync(), producing X509Certificate objects for
self-signed and issuer-signed X.509 v3 certificates. Accept grouped
distinguished names or exact subject DER, public keys, serial numbers,
validity dates, and an explicit signing digest. Reuse crypto.sign() key
inputs and RSA options, including OpenSSL STORE-backed keys.

A PKCS#10 request can supply the subject and public key instead.
Require a synchronous selectExtensions callback to accept, replace, or
amend the requested extensions. Verify the request signature before
signing the certificate, in the selected sync or async mode.

Provide typed Basic Constraints, Key Usage, Extended Key Usage, SAN,
SKI, and AKI, plus arbitrary raw extensions. Add none implicitly and
leave raw extension semantics to the caller. Copy mutable inputs
before queueing asynchronous work. Certificate trust and CA
authorization remain the caller's responsibility.

Fixes: https://github.com/nodejs/node/issues/51169
Assisted-by: Codex
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67245
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-11 10:46:21 +00:00
Aviv Keller 77e63793ad lib: enable web worker api by default
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/65323
Refs: https://github.com/nodejs/node/pull/64894
Refs: https://github.com/nodejs/node/issues/43583
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-11 08:27:59 +00:00
Rafael Gonzaga e8c1160d20 permission: prefer --permission over audit mode
When both --permission and --permission-audit are set, run in enforce
mode as documented, instead of only reporting denials and keeping the
environment variables.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/67036
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-11 01:56:58 +00:00
Philipp Dunkel 985ec87bd1 vfs: do not reuse the path of a loaded memfd image
On Linux an addon or FFI library inside a VFS is loaded from an
anonymous memfd through /proc/self/fd/N, and the memfd was closed
right after a successful load. The next image then got the same fd
number, hence the same path, and the dynamic loader, which knows a
loaded object by the path it was opened with, returned the object
already loaded under that path instead of loading the new file. So
the second of any two addons or libraries loaded from a VFS resolved
to the first: an addon after an FFI library failed with "Module did
not self-register", an FFI library after an addon had none of its
own symbols, and two addons silently became the same one.

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

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

Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: https://github.com/nodejs/node/pull/67068
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-10 23:53:40 +00:00
Fuma ab11f834fc doc: update readable.read() for v26 one-chunk behaviour
Signed-off-by: Fuma2514 <fuma2514@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/67341
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-10 21:45:18 +00:00
Antoine du Hamel bf4534b444 tools: aggregate Nix changes in a table
On large updates, the raw diff is not really human parsable. It can
sometimes exceed the maximum length for comments, resulting in no diff
being shown.
To make reviews easier / more likely to spot something wrong, it now
outputs a table, and report failures in PR checks.

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

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

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

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

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

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

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

Thsi is a POSIX only fix. Windows is unaffected.

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

Fixes: https://github.com/nodejs/node/issues/67141
Signed-off-by: yohannesjoya <yohannesdestagebru10@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67142
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-11-10 12:23:21 +00:00
Node.js GitHub Bot 29290738c1 deps: patch V8 to 15.6.75.50
Refs: https://github.com/v8/v8/compare/15.6.75.33...15.6.75.50
PR-URL: https://github.com/nodejs/node/pull/67335
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-10 01:05:29 +00:00
Node.js GitHub Bot 5c9b456c99 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-10 00:53:03 +00:00
Node.js GitHub Bot e60132f041 test: update WPT for WebCryptoAPI to e87deca336
PR-URL: https://github.com/nodejs/node/pull/67330
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-10 00:35:28 +00:00
Node.js GitHub Bot b8f905a435 tools: update nixpkgs pins
- unstable to 085af13c1607f4f73ab1e7a51071faf6577a7e87
- 26.05 to 57f1c8965649ce5bcac5118a0d2e41f1fbdc56e5

PR-URL: https://github.com/nodejs/node/pull/67334
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-10 00:27:42 +01:00
Daijiro Wachi 6e4ea3d74d doc: fix process import in test runner workerId example
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67316
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-11-09 21:38:04 +00:00
Yuya Inoue f501db8556 test: deflake test-runner-mock-timers-scheduler
The first test case checked that the mocked `scheduler.wait(4000)`
resolved within 100ms of real wall-clock time. On slow or busy CI
machines the time between `Date.now()` and the promise callback can
exceed 100ms even though the mock works, so the test failed with
"time should be advanced less than the 100ms".

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

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

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

Fixes: https://github.com/nodejs/node/issues/66897
Refs: https://github.com/nodejs/node/issues/66803
Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66823
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-09 20:46:30 +00:00
Brad Anderson f39899dc74 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
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-09 18:52:14 +00:00
Trivikram Kamat 75d55af144 ffi: reject multi-argument buffer fast trampolines
The arm64 and x86_64 SysV emitters convert each buffer argument with a
helper call after loading earlier arguments into their target registers.
The call clobbers those registers, so the target would receive wrong
values for every argument before the buffer.

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

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/67046
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-09 17:16:33 +00:00
Antoine du Hamel 04cd8c1f57 tools: use vendored trust store in shell.nix
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67318
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-09 16:07:19 +00:00
Matteo Collina 9aa379e22f 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-09 12:05:43 +00:00
Matteo Collina f344e7f552 worker: preload streams into startup snapshot
Worker stdio loads stream after restoring the main-thread context,
initializing its constructors and prototype methods on every startup.
Preload stream during snapshot construction so workers can restore that
initialized state instead. Worker-specific stdio instances and message
ports are still created at runtime.

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

Assisted-by: pi
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66311
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2026-11-09 06:49:29 +00:00
Matteo Collina 7ae68bd0f4 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-09 06:27:34 +00:00
Matteo Collina 5d59de845c sea: generate a compile cache for the VFS modules
"useCodeCache" was rejected together with "useVfs" because the SEA code
cache is only consumed by the embedder compile paths, while a main
script in the VFS runs through the regular loaders and a main-only cache
would not cover the modules it depends on anyway.

Compile every JavaScript (and, with --strip-types, TypeScript) module in
the VFS when the preparation blob is generated, without executing them,
through a portable CompileCacheHandler keyed by the path relative to the
mount point. The entries are serialized in the cache file layout and
embedded as reserved node:sea:compile-cache/<key> assets, which the SEA
provider hides from the mount. Modules that fail to compile are skipped.

CompileCacheHandler gains a key root for portable caches and in-memory
serialization of its entries, shared with Persist(). The build runs in a
Node.js instance whose environment ignores NODE_COMPILE_CACHE.

Reading the embedded entries at startup is left to a follow-up.

Tests skip up front when building a single executable application on
Windows without signtool, so the async VFS code cache test is skipped
cleanly instead of failing on an unmatched mustCall.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
Assisted-by: pi
PR-URL: https://github.com/nodejs/node/pull/66768
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-09 06:27:20 +00:00
Matteo Collina 768315cf71 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-08 20:34:22 +00:00
Yuya Inoue 82940d6fa5 build: refresh markdown lint dependencies on lockfile changes
Reinstall markdown lint dependencies when the lockfile changes and
recheck all Markdown files with the updated rules.

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

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

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

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

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

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

Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67042
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-11-07 16:25:42 +00:00
manjit singh cab918281e doc: clarify process.loadEnvFile variable precedence (#66315)
Signed-off-by: manjit <manjitcse@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67276
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2026-11-07 15:33:48 +00:00
Node.js GitHub Bot d1a16216fd deps: update undici to 8.12.4
PR-URL: https://github.com/nodejs/node/pull/67272
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2026-11-07 10:42:45 +00:00
junyup0503 66c5a027b6 http: emit 'drain' after flushing coalesced chunks
Since chunked writes are coalesced while the message is corked,
write() decides backpressure from the byte length of the buffered
chunks and sets kNeedDrain. When uncork() flushes them, net.Socket
accounts string chunks in UTF-16 code units, so with multi-byte text it
can stay below its own highWaterMark. It then never needs to drain and
never emits 'drain'. If the flushed writes complete asynchronously, the
check at the end of uncork() also runs while bytes are still pending,
so the response stalls with writableNeedDrain === true and
writableLength === 0.

Re-check the drain condition once the flushed data has been written,
unless the message or its socket has been destroyed in the meantime.

Fixes: https://github.com/nodejs/node/issues/66781
Refs: https://github.com/nodejs/node/pull/64987
Assisted-by: AI coding agent
Signed-off-by: junyup0503 <97156898+junyup0503@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/66782
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2026-11-07 09:33:56 +00:00
Antoine du Hamel d8e22bfdb2 test: fix test-config-json-schema with --openssl-use-def-ca-store
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67200
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-07 09:12:29 +00:00
npm CLI robot a43bfb5bb2 deps: upgrade npm to 12.2.2
PR-URL: https://github.com/nodejs/node/pull/67265
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-07 00:35:47 +00:00
Qingyu Wang 9d8a9adfe8 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-06 18:30:31 +00:00
Aviv Keller 3bd630240b test: use experimental flags in wpt tests
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/67258
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-06 17:13:51 +00:00
Filip Skokan a10b7ecfdf test: use valid PBKDF2 inputs in domain test
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67250
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-06 12:53:33 +00:00
Guilherme Araújo 128f247ea4 sqlite: use 64-bit result APIs for UDF return values
JSValueToSQLiteResult() passed the size_t length of returned
ArrayBuffers and ArrayBufferViews to sqlite3_result_blob(), which
takes an int. Buffers larger than INT_MAX bytes were narrowed,
yielding silently truncated blobs or bogus empty text values.

Use sqlite3_result_blob64() and sqlite3_result_text64(), matching
Statement::BindValue(), so oversized values are rejected with
SQLITE_TOOBIG.

Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67089
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-11-06 11:53:45 +00:00
Christian Aurich Zanettini Martins 280798a30d watch: track all dependencies of an owner
filterFile() reads #ownerDependencies with the dependency path, but
writes the set back keyed by the owner, so each call starts a fresh set
and overwrites the previous one. An owner keeps only the last
dependency registered for it.

unfilterFilesOwnedBy() walks that set to release an owner's
dependencies, so every other one stays in #filteredFiles and
#dependencyOwners. Under `node --test --watch` a restart re-reports the
modules the test still loads, which hides it for those, but a
dependency it stopped requiring is never reported again and keeps
re-running the test.

Read #ownerDependencies with the key it is written with, and collapse
the repeated #dependencyOwners lookup in the loop, which now runs once
per dependency rather than once per owner.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66139
Refs: https://github.com/nodejs/node/pull/45214
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-11-06 10:35:50 +00:00
Antoine du Hamel 3c463ba593 doc: fix security pre-alert template
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67240
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-11-06 09:19:41 +00:00
Filip Skokan 47438d9253 build: sync Torque outputs with V8
15.2 removed the per-source .inc files and replaced bit-fields.h with
bit-field-asserts.cc.

Refs: https://github.com/nodejs/node/pull/65161
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/67238
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-11-06 08:37:02 +00:00
Matteo Collina be6f8f800a crypto: prevent stale OpenSSL errors
Clear errors raised by key comparison, SPKAC parsing, and JWK
import. Ensure TLS and private-key parsing only inspect errors
from their own OpenSSL calls.

Assisted-by: Codex
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/67225
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-06 07:28:07 +00:00
Trivikram Kamat 8e8b4f0a93 ffi: reject signature conflicts from getFunctions getters
A signature getter could request an earlier symbol with a different
signature, making getFunctions() return a wrapper with that signature.
Recheck pending functions before caching them, and throw on a mismatch.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/67194
Fixes: https://github.com/nodejs/node/issues/67192
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-11-06 06:44:45 +00:00
Orgad Shaneh ec4d4c2950 dns: coalesce identical concurrent lookup() requests
When multiple callers issue dns.lookup() for the same (hostname, family,
hints, order) concurrently, only one getaddrinfo call is now dispatched
to the libuv threadpool.  All callers share the result.

getaddrinfo is a blocking call that runs on the libuv threadpool (capped
at 4 threads by default, with a slow I/O concurrency limit of 2).  When
DNS resolution is slow - e.g. ~10-20 s per call due to a misbehaving
resolver - identical requests queue behind each other, causing timeouts
that grow linearly with the number of concurrent callers:

  Before: 100 parallel lookup('host') -> 50 batches × 10 s = 500+ s
  After:  100 parallel lookup('host') -> 1 getaddrinfo  call = ~10 s

This is particularly severe on WSL, where the DNS relay rewrites QNAMEs
in responses (appending the search domain), causing glibc to discard
them as non-matching and wait for a 5s timeout per retry.

The coalescing is keyed on (hostname, family, hints, order) so lookups
with different options still get separate getaddrinfo calls.  Each
caller independently post-processes the shared raw result (applying the
'all' flag, constructing address objects, etc.).

Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Fixes: https://github.com/nodejs/node/issues/62503
PR-URL: https://github.com/nodejs/node/pull/62599
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-11-06 03:18:17 +00:00