This is a security release.
Notable changes:
* CVE-2024-27983 - Assertion failed in node::http2::Http2Session::\~Http2Session() leads to HTTP/2 server crash- (High)
* CVE-2024-27982 - HTTP Request Smuggling via Content Length Obfuscation - (Medium)
* llhttp version 9.2.1
* undici version 5.28.4
PR-URL: https://github.com/nodejs-private/node-private/pull/573
Notable changes:
Added support for import attributes:
Support has been added for import attributes, to replace the old import
assertions syntax. This will aid migration by making the new syntax
available across all currently supported Node.js release lines.
For more details, see
* [#50134](https://github.com/nodejs/node/issues/50134)
* [#51622](https://github.com/nodejs/node/issues/51622)
Doc deprecation for `dirent.path`:
Please use newly added `dirent.parentPath` instead.
Experimental node-api feature flags
Introduces an experimental feature to segregate finalizers that affect GC state.
A new type called `node_api_nogc_env` has been introduced as the const version
of `napi_env` and `node_api_nogc_finalize` as a variant of `napi_finalize` that
accepts a `node_api_nogc_env` as its first argument.
This feature can be turned off by defining
`NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT`.
Root certificates updated to NSS 3.98:
Certificates added:
* Telekom Security TLS ECC Root 2020
* Telekom Security TLS RSA Root 2023
Certificates removed:
* Security Communication Root CA
Updated dependencies:
* ada updated to 2.7.6.
* base64 updated to 0.5.2.
* c-ares updated to 1.27.0.
* corepack updated to 0.25.2.
* ICU updated to 74.2. Includes CLDR 44.1 and Unicode 15.1.
* npm updated to 10.5.0. Fixes a regression in signals not being passed onto child processes.
* simdutf8 updated to 4.0.8.
* Timezone updated to 2024a.
* zlib updated to 1.3.0.1-motley-40e35a7.
vm: fix V8 compilation cache support for vm.Script:
Previously repeated compilation of the same source code using `vm.Script`
stopped hitting the V8 compilation cache after v16.x when support for
`importModuleDynamically` was added to `vm.Script`, resulting in a performance
regression that blocked users (in particular Jest users) from upgrading from
v16.x.
The recent fixes allow the compilation cache to be hit again
for `vm.Script` when `--experimental-vm-modules` is not used even in the
presence of the `importModuleDynamically` option, so that users affected by the
performance regression can now upgrade. Ongoing work is also being done to
enable compilation cache support for `vm.CompileFunction`.
PR-URL: https://github.com/nodejs/node/pull/52165
We define a new type called `node_api_nogc_env` as the `const` version
of `napi_env` and `node_api_nogc_finalize` as a variant of
`napi_finalize` that accepts a `node_api_nogc_env` as its first
argument.
We then modify those APIs which do not affect GC state as accepting a
`node_api_nogc_env`. APIs accepting finalizer callbacks are modified to
accept `node_api_nogc_finalize` callbacks. Thus, the only way to attach
a `napi_finalize` callback, wherein Node-APIs affecting GC state may be
called is to call `node_api_post_finalizer` from a
`node_api_nogc_finalize` callback.
In keeping with the process of introducing new Node-APIs, this feature
is guarded by `NAPI_EXPERIMENTAL`. Since this feature modifies APIs
already marked as stable, it is additionally guared by
`NODE_API_EXPERIMENTAL_NOGC_ENV`, so as to provide a further buffer to
adoption. Nevertheless, both guards must be removed upon releasing a
new version of Node-API.
PR-URL: https://github.com/nodejs/node/pull/50060
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Backport-PR-URL: https://github.com/nodejs/node/pull/51804
(cherry picked from commit 7a216d5fd6)
Add a flag for each experimental feature to indicate its presence.
That way, if we compile with `NAPI_EXPERIMENTAL` turned on, we'll be
able to distinguish between what `NAPI_EXPERIMENTAL` used to mean on an
old version of the headers when compiling against such an old version,
and what it means on a new version of Node.js.
PR-URL: https://github.com/nodejs/node/pull/50991
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Backport-PR-URL: https://github.com/nodejs/node/pull/51804
(cherry picked from commit 727dd28e47)
c-ares has made intentional changes to the behavior of TXT records
to comply with RFC 7208, which concatenates multiple strings for
the same TXT record into a single string. Multiple TXT records
are not concatenated.
Also, response handling has changed, such that a response which is
completely invalid in formatting is thrown away as a malicious
forged/spoofed packet rather than returning EBADRESP. This is one
step toward RFC 9018 (EDNS COOKIES) which will require the message
to at least be structurally valid to validate against spoofed
records.
Fix By: Brad House (@bradh352)
PR-URL: https://github.com/nodejs/node/pull/50743
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fixes: https://github.com/nodejs/node/issues/50741
Refs: https://github.com/nodejs/node/issues/50444
The old import assertions proposal has been
renamed to "import attributes" with the following major changes:
1. The keyword is now `with` instead of `assert`.
2. Unknown assertions cause an error rather than being ignored.
This PR updates the documentation to encourage folks to use the new
syntax, and add aliases to preserve backward compatibility.
PR-URL: https://github.com/nodejs/node/pull/50141
Backport-PR-URL: https://github.com/nodejs/node/pull/51136
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Original commit message:
Reland "[import-attributes] Implement import attributes, with `assert` fallback"
This is a reland of commit 159c82c5e6392e78b9bba7161b1bed6e23758984, to set the correct author.
Original change's description:
> [import-attributes] Implement import attributes, with `assert` fallback
>
> In the past six months, the old import assertions proposal has been
> renamed to "import attributes" with the follwing major changes:
> 1. the keyword is now `with` instead of `assert`
> 2. unknown assertions cause an error rather than being ignored
>
> To preserve backward compatibility with existing applications that use
> `assert`, implementations _can_ keep it around as a fallback for both
> the static and dynamic forms.
>
> Additionally, the proposal has some minor changes that came up during
> the stage 3 reviews:
> 3. dynamic import first reads all the attributes, and then verifies
> that they are all strings
> 4. there is no need for a `[no LineTerminator here]` restriction before
> the `with` keyword
> 5. static import syntax allows any `LiteralPropertyName` as attribute
> keys, to align with every other syntax using key-value pairs
>
> The new syntax is enabled by a new `--harmony-import-attributes` flag,
> disabled by default. However, the new behavioral changes also apply to
> the old syntax that is under the `--harmony-import-assertions` flag.
>
> This patch does implements (1), (3), (4) and (5). Handling of unknown
> import assertions was not implemented directly in V8, but delegated
> to embedders. As such, it will be implemented separately in d8 and
> Chromium.
>
> To simplify the review, this patch doesn't migrate usage of the term
> "assertions" to "attributes". There are many variables and internal
> functions that could be easily renamed as soon as this patch landes.
> There is one usage in the public API
> (`ModuleRequest::GetImportAssertions`) that will probably need to be
> aliased and then removed following the same process as for other API
> breaking changes.
>
> Bug: v8:13856
> Change-Id: I78b167348d898887332c5ca7468bc5d58cd9b1ca
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4632799
> Commit-Queue: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#89110}
Bug: v8:13856
Change-Id: Ic59aa3bd9101618e47ddf6cf6d6416a3a438ebec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4705558
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#89115}
Refs: https://github.com/v8/v8/commit/a0fd3209dda8527d7da810abe231df27fffe789e
PR-URL: https://github.com/nodejs/node/pull/51136
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>