Skip to content

Commit 331ad93

Browse files
authored
Merge branch 'main' into ffi
2 parents 643d0b2 + a9ac9b1 commit 331ad93

1,218 files changed

Lines changed: 57546 additions & 18973 deletions

File tree

Some content is hidden

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

.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/*

.github/workflows/linters.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ jobs:
154154
run: |
155155
nix-shell -I nixpkgs=./tools/nix/pkgs.nix -p 'nixfmt-tree' --run '
156156
treefmt --quiet --ci
157-
' || git --no-pager diff --exit-code
157+
' && EXIT_CODE="$?" || EXIT_CODE="$?"
158+
if [ "$EXIT_CODE" != "0" ]
159+
then
160+
git --no-pager diff || true
161+
exit "$EXIT_CODE"
162+
fi
158163
159164
lint-py:
160165
if: github.event.pull_request.draft == false

.github/workflows/notify-on-push.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,16 @@ jobs:
3030

3131
validateCommitMessage:
3232
name: Notify on Push on `main` with invalid message
33-
if: github.repository == 'nodejs/node'
3433
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
3534
runs-on: ubuntu-24.04-arm
3635
steps:
37-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38-
with:
39-
persist-credentials: false
40-
- name: Check commit message
36+
- name: Validate commits
37+
run: echo "$COMMITS" | npx -q core-validate-commit -
4138
id: commit-check
42-
run: npx -q core-validate-commit "$COMMIT"
4339
env:
44-
COMMIT: ${{ github.event.after }}
40+
COMMITS: ${{ toJSON(github.event.commits) }}
4541
- name: Slack Notification
46-
if: ${{ failure() && steps.commit-check.conclusion == 'failure' }}
42+
if: ${{ failure() && steps.commit-check.conclusion == 'failure' && github.repository == 'nodejs/node' }}
4743
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3
4844
env:
4945
SLACK_COLOR: '#DE512A'

.github/workflows/timezone-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
with:
5858
author: Node.js GitHub Bot <github-bot@iojs.org>
5959
body: |
60-
This PR was generated by tools/timezone-update.yml.
60+
This PR was generated by `.github/workflows/timezone-update.yml` and `tools/update-timezone.mjs`.
6161
6262
Updates the ICU files as per the instructions present in https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-icu.md#time-zone-data
6363

.github/workflows/tools.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ jobs:
122122
run: |
123123
make corepack-update
124124
echo "NEW_VERSION=$(node deps/corepack/dist/corepack.js --version)" >> $GITHUB_ENV
125-
- id: doc-kit
126-
subsystem: tools
127-
label: tools
128-
run: |
129-
./tools/dep_updaters/update-doc.sh > temp-output
130-
cat temp-output
131-
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
132-
rm temp-output
133125
- id: googletest
134126
subsystem: deps
135127
label: dependencies, test

BUILDING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,9 @@ If you are running tests before submitting a pull request, use:
404404
make -j4 test
405405
```
406406

407-
`make -j4 test` does a full check on the codebase, including running linters and
408-
documentation tests.
407+
`make -j4 test` does a full check on the codebase, including documentation tests.
409408

410-
To run the linter without running tests, use
411-
`make lint`/`vcbuild lint`. It will lint JavaScript, C++, and Markdown files.
409+
To run the linter, use `make lint`/`vcbuild lint`. It will lint JavaScript, C++, and Markdown files.
412410

413411
To fix auto fixable JavaScript linting errors, use `make lint-js-fix`.
414412

CHANGELOG.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ release.
4141
</tr>
4242
<tr>
4343
<td valign="top">
44-
<b><a href="doc/changelogs/CHANGELOG_V25.md#25.8.0">25.8.0</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/>
46+
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.1">25.8.1</a><br/>
47+
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.0">25.8.0</a><br/>
4548
<a href="doc/changelogs/CHANGELOG_V25.md#25.7.0">25.7.0</a><br/>
4649
<a href="doc/changelogs/CHANGELOG_V25.md#25.6.1">25.6.1</a><br/>
4750
<a href="doc/changelogs/CHANGELOG_V25.md#25.6.0">25.6.0</a><br/>
@@ -54,7 +57,8 @@ release.
5457
<a href="doc/changelogs/CHANGELOG_V25.md#25.0.0">25.0.0</a><br/>
5558
</td>
5659
<td valign="top">
57-
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.14.0">24.14.0</a></b><br/>
60+
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.14.1">24.14.1</a></b><br/>
61+
<a href="doc/changelogs/CHANGELOG_V24.md#24.14.0">24.14.0</a><br/>
5862
<a href="doc/changelogs/CHANGELOG_V24.md#24.13.1">24.13.1</a><br/>
5963
<a href="doc/changelogs/CHANGELOG_V24.md#24.13.0">24.13.0</a><br/>
6064
<a href="doc/changelogs/CHANGELOG_V24.md#24.12.0">24.12.0</a><br/>
@@ -76,18 +80,22 @@ release.
7680
<a href="doc/changelogs/CHANGELOG_V24.md#24.0.0">24.0.0</a><br/>
7781
</td>
7882
<td valign="top">
79-
<b><a href="doc/changelogs/CHANGELOG_V22.md#22.22.1">22.22.1</a></b><br/>
80-
<a href="doc/changelogs/CHANGELOG_V22.md#22.22.0">22.22.0</a><br/>
81-
<a href="doc/changelogs/CHANGELOG_V22.md#22.21.1">22.21.1</a><br/>
82-
<a href="doc/changelogs/CHANGELOG_V22.md#22.21.0">22.21.0</a><br/>
83-
<a href="doc/changelogs/CHANGELOG_V22.md#22.20.0">22.20.0</a><br/>
84-
<a href="doc/changelogs/CHANGELOG_V22.md#22.19.0">22.19.0</a><br/>
85-
<a href="doc/changelogs/CHANGELOG_V22.md#22.18.0">22.18.0</a><br/>
86-
<a href="doc/changelogs/CHANGELOG_V22.md#22.17.1">22.17.1</a><br/>
87-
<a href="doc/changelogs/CHANGELOG_V22.md#22.17.0">22.17.0</a><br/>
88-
<a href="doc/changelogs/CHANGELOG_V22.md#22.16.0">22.16.0</a><br/>
89-
<a href="doc/changelogs/CHANGELOG_V22.md#22.15.1">22.15.1</a><br/>
90-
<a href="doc/changelogs/CHANGELOG_V22.md#22.15.0">22.15.0</a><br/>
83+
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.11.0">23.11.0</a></b><br/>
84+
<a href="doc/changelogs/CHANGELOG_V23.md#23.10.0">23.10.0</a><br/>
85+
<a href="doc/changelogs/CHANGELOG_V23.md#23.9.0">23.9.0</a><br/>
86+
<a href="doc/changelogs/CHANGELOG_V23.md#23.8.0">23.8.0</a><br/>
87+
<a href="doc/changelogs/CHANGELOG_V23.md#23.7.0">23.7.0</a><br/>
88+
<a href="doc/changelogs/CHANGELOG_V23.md#23.6.1">23.6.1</a><br/>
89+
<a href="doc/changelogs/CHANGELOG_V23.md#23.6.0">23.6.0</a><br/>
90+
<a href="doc/changelogs/CHANGELOG_V23.md#23.5.0">23.5.0</a><br/>
91+
<a href="doc/changelogs/CHANGELOG_V23.md#23.4.0">23.4.0</a><br/>
92+
<a href="doc/changelogs/CHANGELOG_V23.md#23.3.0">23.3.0</a><br/>
93+
<a href="doc/changelogs/CHANGELOG_V23.md#23.2.0">23.2.0</a><br/>
94+
<a href="doc/changelogs/CHANGELOG_V23.md#23.1.0">23.1.0</a><br/>
95+
<a href="doc/changelogs/CHANGELOG_V23.md#23.0.0">23.0.0</a><br/>
96+
</td>
97+
<td valign="top">
98+
<b><a href="doc/changelogs/CHANGELOG_V22.md#22.15.0">22.15.0</a></b><br/>
9199
<a href="doc/changelogs/CHANGELOG_V22.md#22.14.0">22.14.0</a><br/>
92100
<a href="doc/changelogs/CHANGELOG_V22.md#22.13.1">22.13.1</a><br/>
93101
<a href="doc/changelogs/CHANGELOG_V22.md#22.13.0">22.13.0</a><br/>
@@ -108,7 +116,8 @@ release.
108116
<a href="doc/changelogs/CHANGELOG_V22.md#22.0.0">22.0.0</a><br/>
109117
</td>
110118
<td valign="top">
111-
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.20.1">20.20.1</a></b><br/>
119+
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.20.2">20.20.2</a></b><br/>
120+
<a href="doc/changelogs/CHANGELOG_V20.md#20.20.1">20.20.1</a><br/>
112121
<a href="doc/changelogs/CHANGELOG_V20.md#20.20.0">20.20.0</a><br/>
113122
<a href="doc/changelogs/CHANGELOG_V20.md#20.19.6">20.19.6</a><br/>
114123
<a href="doc/changelogs/CHANGELOG_V20.md#20.19.5">20.19.5</a><br/>

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ coverage-run-js: ## Run JavaScript tests with coverage.
338338

339339
.PHONY: test
340340
# This does not run tests of third-party libraries inside deps.
341-
test: all ## Run default tests, linters, and build docs.
341+
test: all ## Run default tests and build docs.
342342
$(MAKE) -s tooltest
343343
$(MAKE) -s build-addons
344344
$(MAKE) -s build-js-native-api-tests
@@ -348,7 +348,7 @@ test: all ## Run default tests, linters, and build docs.
348348
$(MAKE) -s jstest
349349

350350
.PHONY: test-only
351-
test-only: all ## Run default tests, without linters or building the docs.
351+
test-only: all ## Run default tests without building the docs.
352352
$(MAKE) build-addons
353353
$(MAKE) build-js-native-api-tests
354354
$(MAKE) build-node-api-tests
@@ -384,7 +384,7 @@ ifeq ($(OSTYPE),os400)
384384
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
385385
endif
386386

387-
DOC_KIT ?= tools/doc/node_modules/@nodejs/doc-kit/bin/cli.mjs
387+
DOC_KIT ?= tools/doc/node_modules/@node-core/doc-kit/bin/cli.mjs
388388

389389
node_use_openssl_and_icu = $(call available-node,"-p" \
390390
"process.versions.openssl != undefined && process.versions.icu != undefined")
@@ -856,6 +856,10 @@ out/doc/api: doc/api
856856
# Using grouped targets (&:) so Make knows one command produces all outputs
857857
ifeq ($(OSTYPE),aix)
858858
# TODO(@nodejs/web-infra): AIX is currently hanging during HTML minification
859+
$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json:
860+
@echo "Skipping $@ (not currently supported by $(OSTYPE) machines)"
861+
else ifeq ($(OSTYPE),os400)
862+
# TODO(@nodejs/web-infra): IBMi is currently hanging during HTML minification
859863
$(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json:
860864
@echo "Skipping $@ (not currently supported by $(OSTYPE) machines)"
861865
else

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

benchmark/buffers/buffer-bytelength-string.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common');
44
const bench = common.createBenchmark(main, {
55
type: ['one_byte', 'two_bytes', 'three_bytes',
66
'four_bytes', 'latin1'],
7-
encoding: ['utf8', 'base64'],
7+
encoding: ['utf8', 'base64', 'latin1', 'hex'],
88
repeat: [1, 2, 16, 256], // x16
99
n: [4e6],
1010
});

0 commit comments

Comments
 (0)