Skip to content

Commit d950270

Browse files
committed
Merge branch 'main' of https://github.com/nodejs/node
2 parents 57d3b1c + 5ff1eab commit d950270

File tree

96 files changed

+5017
-1324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+5017
-1324
lines changed

.github/workflows/auto-start-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
- name: Get Pull Requests
2929
id: get_prs_for_ci
3030
run: >
31-
numbers=$(gh pr list \
32-
--repo ${{ github.repository }} \
31+
echo "numbers=$(gh pr list \
32+
--repo "$GITHUB_REPOSITORY" \
3333
--label 'request-ci' \
3434
--json 'number' \
35+
--search 'review:approved' \
3536
-t '{{ range . }}{{ .number }} {{ end }}' \
36-
--limit 5)
37-
echo "numbers=$numbers" >> $GITHUB_OUTPUT
37+
--limit 5)" >> "$GITHUB_OUTPUT"
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
start-ci:

.github/workflows/commit-lint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: First commit message adheres to guidelines
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- v[0-9]+.x-staging
48

59
env:
610
NODE_VERSION: lts/*

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ release.
4141
</tr>
4242
<tr>
4343
<td valign="top">
44-
<b><a href="doc/changelogs/CHANGELOG_V25.md#25.8.2">25.8.2</a></b><br/>
44+
<b><a href="doc/changelogs/CHANGELOG_V25.md#25.9.0">25.9.0</a></b><br/>
45+
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.2">25.8.2</a><br/>
4546
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.1">25.8.1</a><br/>
4647
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.0">25.8.0</a><br/>
4748
<a href="doc/changelogs/CHANGELOG_V25.md#25.7.0">25.7.0</a><br/>

SECURITY.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -152,28 +152,33 @@ does not trust is considered a vulnerability:
152152
the correct use of Node.js APIs.
153153
* The unavailability of the runtime, including the unbounded degradation of its
154154
performance.
155-
* Memory leaks qualify as vulnerabilities when all of the following criteria are met:
156-
* The API is being correctly used.
157-
* The API doesn't have a warning against its usage in a production environment.
158-
* The API is public and documented.
159-
* The API is on stable (2.0) status.
160-
* The memory leak is significant enough to cause a denial of service quickly
161-
or in a context not controlled by the user (for example, HTTP parsing).
162-
* The memory leak is directly exploitable by an untrusted source without requiring application mistakes.
163-
* The leak cannot be reasonably mitigated through standard operational practices (like process recycling).
164-
* The leak occurs deterministically under normal usage patterns rather than edge cases.
165-
* The leak occurs at a rate that would cause practical resource exhaustion within a practical timeframe under
166-
typical workloads.
167-
* The attack demonstrates [asymmetric resource consumption](https://cwe.mitre.org/data/definitions/405.html),
168-
where the attacker expends significantly fewer resources than what's required by the server to process the
169-
attack. Attacks requiring comparable resources on the attacker's side (which can be mitigated through common
170-
practices like rate limiting) may not qualify.
171155

172156
If Node.js loads configuration files or runs code by default (without a
173157
specific request from the user), and this is not documented, it is considered a
174158
vulnerability.
175159
Vulnerabilities related to this case may be fixed by a documentation update.
176160

161+
#### Denial of Service (DoS) vulnerabilities
162+
163+
For a behavior to be considered a DoS vulnerability, the PoC must meet the following criteria:
164+
165+
* The API is being correctly used.
166+
* The API doesn't have a warning against its usage in a production environment.
167+
* The API is public and documented. If the API comes from JavaScript, the behavior must be
168+
well-defined in the [ECMAScript specification](https://tc39.es/ecma262/).
169+
* The API has stable (2.0) status.
170+
* The behavior is significant enough to cause a denial of service quickly
171+
or in a context not controlled by the Node.js application developer (for example, HTTP parsing).
172+
* The behavior is directly exploitable by an untrusted source without requiring application mistakes.
173+
* The behavior cannot be reasonably mitigated through standard operational practices (like process recycling).
174+
* The behavior occurs deterministically under normal usage patterns rather than edge cases.
175+
* The behavior occurs at a rate that would cause practical resource exhaustion within a practical timeframe under
176+
typical workloads.
177+
* The attack demonstrates [asymmetric resource consumption](https://cwe.mitre.org/data/definitions/405.html),
178+
where the attacker expends significantly fewer resources than what's required by the server to process the
179+
attack. Attacks requiring comparable resources on the attacker's side (which can be mitigated through common
180+
practices like rate limiting) may not qualify.
181+
177182
**Node.js does NOT trust**:
178183

179184
* Data received from the remote end of inbound network connections

configure.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,9 @@ def get_cargo_version(cargo):
14521452
except OSError:
14531453
error('''No acceptable cargo found!
14541454
1455-
Please make sure you have cargo installed on your system.''')
1455+
Please make sure you have cargo installed on your system and/or
1456+
consider adjusting the CARGO environment variable if you have installed
1457+
it in a non-standard prefix.''')
14561458

14571459
with proc:
14581460
cargo_ret = to_utf8(proc.communicate()[0])
@@ -1540,8 +1542,9 @@ def check_compiler(o):
15401542
# Minimum cargo and rustc versions should match values in BUILDING.md.
15411543
min_cargo_ver_tuple = (1, 82)
15421544
min_rustc_ver_tuple = (1, 82)
1543-
cargo_ver = get_cargo_version('cargo')
1544-
print_verbose(f'Detected cargo: {cargo_ver}')
1545+
cargo = os.environ.get('CARGO', 'cargo')
1546+
cargo_ver = get_cargo_version(cargo)
1547+
print_verbose(f'Detected cargo (CARGO={cargo}): {cargo_ver}')
15451548
cargo_ver_tuple = tuple(map(int, cargo_ver.split('.')))
15461549
if cargo_ver_tuple < min_cargo_ver_tuple:
15471550
warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}')
@@ -2751,6 +2754,11 @@ def make_bin_override():
27512754
# will fail to run python scripts.
27522755
gyp_args += ['-Dpython=' + python]
27532756

2757+
if options.v8_enable_temporal_support and not options.shared_temporal_capi:
2758+
cargo = os.environ.get('CARGO')
2759+
if cargo:
2760+
gyp_args += ['-Dcargo=' + cargo]
2761+
27542762
if options.use_ninja:
27552763
gyp_args += ['-f', 'ninja-' + flavor]
27562764
elif flavor == 'win' and sys.platform != 'msys':

deps/crates/crates.gyp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
'variables': {
3+
'cargo%': 'cargo',
34
'cargo_vendor_dir': './vendor',
45
},
56
'conditions': [
@@ -48,7 +49,7 @@
4849
'<(node_crates_libpath)'
4950
],
5051
'action': [
51-
'cargo',
52+
'<(cargo)',
5253
'rustc',
5354
'<@(cargo_build_flags)',
5455
'--frozen',

doc/api/async_context.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ try {
389389
### `asyncLocalStorage.withScope(store)`
390390

391391
<!-- YAML
392-
added: REPLACEME
392+
added: v25.9.0
393393
-->
394394

395395
> Stability: 1 - Experimental
@@ -527,7 +527,7 @@ probably responsible for the context loss.
527527
## Class: `RunScope`
528528

529529
<!-- YAML
530-
added: REPLACEME
530+
added: v25.9.0
531531
-->
532532

533533
> Stability: 1 - Experimental
@@ -543,7 +543,7 @@ exits, whether through normal completion or by throwing an error.
543543
### `scope.dispose()`
544544

545545
<!-- YAML
546-
added: REPLACEME
546+
added: v25.9.0
547547
-->
548548

549549
Explicitly ends the scope and restores the previous store value. This method

doc/api/cli.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ Enable experimental support for storage inspection
12801280
### `--experimental-stream-iter`
12811281

12821282
<!-- YAML
1283-
added: REPLACEME
1283+
added: v25.9.0
12841284
-->
12851285

12861286
> Stability: 1 - Experimental
@@ -2784,6 +2784,38 @@ changes:
27842784
Configures the test runner to only execute top level tests that have the `only`
27852785
option set. This flag is not necessary when test isolation is disabled.
27862786

2787+
### `--test-random-seed`
2788+
2789+
<!-- YAML
2790+
added: REPLACEME
2791+
-->
2792+
2793+
Set the seed used to randomize test execution order. This applies to both test
2794+
file execution order and queued tests within each file. Providing this flag
2795+
enables randomization implicitly, even without `--test-randomize`.
2796+
2797+
The value must be an integer between `0` and `4294967295`.
2798+
2799+
This flag cannot be used with `--watch` or `--test-rerun-failures`.
2800+
2801+
### `--test-randomize`
2802+
2803+
<!-- YAML
2804+
added: REPLACEME
2805+
-->
2806+
2807+
Randomize test execution order. This applies to both test file execution order
2808+
and queued tests within each file. This can help detect tests that rely on
2809+
shared state or execution order.
2810+
2811+
The seed used for randomization is printed in the test summary and can be
2812+
reused with `--test-random-seed`.
2813+
2814+
For detailed behavior and examples, see
2815+
[randomizing tests execution order][].
2816+
2817+
This flag cannot be used with `--watch` or `--test-rerun-failures`.
2818+
27872819
### `--test-reporter`
27882820

27892821
<!-- YAML
@@ -3702,6 +3734,8 @@ one is included in the list below.
37023734
* `--test-isolation`
37033735
* `--test-name-pattern`
37043736
* `--test-only`
3737+
* `--test-random-seed`
3738+
* `--test-randomize`
37053739
* `--test-reporter-destination`
37063740
* `--test-reporter`
37073741
* `--test-rerun-failures`
@@ -4286,6 +4320,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
42864320
[libuv threadpool documentation]: https://docs.libuv.org/en/latest/threadpool.html
42874321
[module compile cache]: module.md#module-compile-cache
42884322
[preloading asynchronous module customization hooks]: module.md#registration-of-asynchronous-customization-hooks
4323+
[randomizing tests execution order]: test.md#randomizing-tests-execution-order
42894324
[remote code execution]: https://www.owasp.org/index.php/Code_Injection
42904325
[running tests from the command line]: test.md#running-tests-from-the-command-line
42914326
[scavenge garbage collector]: https://v8.dev/blog/orinoco-parallel-scavenger

doc/api/deprecations.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4488,7 +4488,7 @@ changes:
44884488
- version: REPLACEME
44894489
pr-url: https://github.com/nodejs/node/pull/62453
44904490
description: Runtime deprecation.
4491-
- version: REPLACEME
4491+
- version: v25.9.0
44924492
pr-url: https://github.com/nodejs/node/pull/62321
44934493
description: Documentation-only deprecation.
44944494
-->
@@ -4513,7 +4513,7 @@ changes:
45134513
- version: REPLACEME
45144514
pr-url: https://github.com/nodejs/node/pull/62453
45154515
description: Runtime deprecation.
4516-
- version: REPLACEME
4516+
- version: v25.9.0
45174517
pr-url: https://github.com/nodejs/node/pull/62321
45184518
description: Documentation-only deprecation.
45194519
-->
@@ -4528,15 +4528,26 @@ deprecated and will throw an error in a future version.
45284528
<!-- YAML
45294529
changes:
45304530
- version: REPLACEME
4531+
pr-url: https://github.com/nodejs/node/pull/62401
4532+
description: Runtime deprecation.
4533+
- version: v25.9.0
45314534
pr-url: https://github.com/nodejs/node/pull/62395
45324535
description: Documentation-only deprecation.
45334536
-->
45344537
4535-
Type: Documentation-only
4538+
Type: Runtime
45364539
45374540
[`module.register()`][] is deprecated. Use [`module.registerHooks()`][]
45384541
instead.
45394542
4543+
The `module.register()` API provides off-thread async hooks for customizing ES modules;
4544+
the `module.registerHooks()` API provides similar hooks that are synchronous, in-thread, and
4545+
work for all types of modules.
4546+
Supporting async hooks has proven to be complex, involving worker threads orchestration, and there are issues
4547+
that have proven unresolveable. See [caveats of asynchronous customization hooks][]. Please migrate to
4548+
`module.registerHooks()` as soon as possible as `module.register()` will be
4549+
removed in a future version of Node.js.
4550+
45404551
[DEP0142]: #dep0142-repl_builtinlibs
45414552
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
45424553
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4696,6 +4707,7 @@ instead.
46964707
[`zlib.bytesWritten`]: zlib.md#zlibbyteswritten
46974708
[alloc]: buffer.md#static-method-bufferallocsize-fill-encoding
46984709
[alloc_unsafe_size]: buffer.md#static-method-bufferallocunsafesize
4710+
[caveats of asynchronous customization hooks]: module.md#caveats-of-asynchronous-customization-hooks
46994711
[from_arraybuffer]: buffer.md#static-method-bufferfromarraybuffer-byteoffset-length
47004712
[from_string_encoding]: buffer.md#static-method-bufferfromstring-encoding
47014713
[legacy URL API]: url.md#legacy-url-api

0 commit comments

Comments
 (0)