31054 Commits
Author SHA1 Message Date
Richard Lau 461e0e4e15 Working on v12.22.13
PR-URL: https://github.com/nodejs/node/pull/42531
2022-04-05 08:10:19 -04:00
Richard Lau a3d28373d3 2022-04-05, Version 12.22.12 'Erbium' (LTS)
Notable changes:

This is planned to be the final Node.js 12 release. Node.js 12 will
reach End-of-Life status on 30 April 2022, after which it will no
receive updates. You are strongly advised to migrate your applications
to Node.js 16 or 14 (both of which are Long Term Support (LTS) releases)
to continue to receive future security updates beyond 30 April 2022.

This release fixes a shutdown crash in Node-API (formerly N-API) and a
potential stack overflow when using `vm.runInNewContext()`.

The list of GPG keys used to sign releases and instructions on how to
fetch the keys for verifying binaries has been synchronized with the
main branch.

PR-URL: https://github.com/nodejs/node/pull/42531
v12.22.12
2022-04-03 13:49:04 -04:00
Igor Mikhalev 333eda8d03 doc: add a note about possible missing lines to readline.asyncIterator
Fixes: https://github.com/nodejs/node/issues/33463

PR-URL: https://github.com/nodejs/node/pull/34675
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-04-03 13:47:11 -04:00
Nick Schonning 518a49c0c6 doc: use openpgp.org for keyserver examples
The sks-keyservers.net is no longer listed by DNS

PR-URL: https://github.com/nodejs/node/pull/39227
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-03-30 12:19:21 -04:00
Danielle Adams 11aef2ad03 doc: update release key for Danielle Adams
PR-URL: https://github.com/nodejs/node/pull/36793
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-30 12:11:35 -04:00
Danielle Adams a9c38f1003 doc: add release key for Danielle Adams
Add Danielle Adams's release key.

PR-URL: https://github.com/nodejs/node/pull/35545
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-03-30 12:11:35 -04:00
legendecas 5f104e3218 node-api: cctest on v8impl::Reference
PR-URL: https://github.com/nodejs/node/pull/38970
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
2022-03-30 10:49:30 -04:00
Michael Dawson e23c04f0dc node-api: avoid SecondPassCallback crash
PR https://github.com/nodejs/node/pull/38000 added
indirection so that we could stop finalization in
cases where it had been scheduled in a second
pass callback but we were doing it in advance in
environment teardown.

Unforunately we missed that the code which tries
to clear the second pass parameter checked if
the pointer to the parameter (_secondPassParameter)
was nullptr and that when the second pass callback
was scheduled we set _secondPassParameter to nullptr
in order to avoid it being deleted outside of the second
pass callback. The net result was that we
would not clear the _secondPassParameter contents
and failed to avoid the Finalization in the second pass
callback.

This PR adds an additional boolean for deciding if
the secondPassParameter should be deleted outside
of the second pass callback instead of setting
secondPassParameter to nullptr thus avoiding the
conflict between the 2 ways it was being used.

See the discussion starting at:
https://github.com/nodejs/node/pull/38273#issuecomment-852403751
for how this was discovered on OSX while trying to
upgrade to a new V8 version.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/38899
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-30 10:49:27 -04:00
Michael Dawson a7224c9559 node-api: fix shutdown crashes
Refs: https://github.com/nodejs/node-addon-api/issues/906

Ensure that finalization is not defered during shutdown.
The env for the addon is deleted immediately after
iterating the list of finalizers to be run. Defering
causes crashes as the finalization uses the already
deleted env.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/38492
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
2022-03-30 10:49:11 -04:00
James M Snell e707514c80 src: fix finalization crash
PR-URL: https://github.com/nodejs/node/pull/38250
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Fixes: https://github.com/nodejs/node/issues/38040
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-03-30 10:49:08 -04:00
Chengzhong Wu 81b4dc88f1 node-api: make reference weak parameter an indirect link to references
As the cancellation of second pass callbacks are not reachable from the
current v8 API, and the second pass callbacks are scheduled with
NodePlatform's task runner, we have to ensure that the weak parameter
holds indirect access to the v8impl::Reference object so that the object
can be destroyed on addon env teardown before the whole node env is able
to shutdown.

PR-URL: https://github.com/nodejs/node/pull/38000
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2022-03-30 10:49:01 -04:00
Michael Dawson 2aa9ca1ea9 node-api: fix crash in finalization
Refs: https://github.com/nodejs/node-addon-api/issues/906
Refs: https://github.com/nodejs/node/pull/37616

Fix crash introduced by https://github.com/nodejs/node/pull/37616

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/37876
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-30 10:48:44 -04:00
Gabriel Schulhof a2f4206415 node-api: stop ref gc during environment teardown
A gc may happen during environment teardown. Thus, during finalization
initiated by environment teardown we must remove the V8 finalizer
before calling the Node-API finalizer.

Fixes: https://github.com/nodejs/node/issues/37236
PR-URL: https://github.com/nodejs/node/pull/37616
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-03-30 10:48:01 -04:00
Gabriel SchulhofandChengzhong Wu 171bb66ccc node-api: force env shutdown deferring behavior
The finalizer normally never gets called while a reference is strong.
However, during environment shutdown all finalizers must get called. In
order to unify the deferring behavior with that of a regular
finalization, we must force the reference to be weak when we call its
finalizer during environment shutdown.

Fixes: https://github.com/nodejs/node/issues/37236
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/37303
Backport-PR-URL: https://github.com/nodejs/node/pull/42512
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-03-30 10:47:52 -04:00
devsnek 1193290f3f deps: V8: cherry-pick cc9a8a37445e
Original commit message:

    fix overflow check in error formatting

    Bug: v8:12494
    Change-Id: Iba2684173296aa236f1a1c73a5606c21472eff06
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3426634
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Gus Caplan <snek@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#78909}

Refs: https://github.com/v8/v8/commit/cc9a8a37445eeffff17474020bb6038c2f9af9fc

PR-URL: https://github.com/nodejs/node/pull/42065
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-30 13:01:01 +01:00
Bryan English a35f553889 doc: add release key for Bryan English
Adds Bryan English and his public key to the README for releases.

PR-URL: https://github.com/nodejs/node/pull/42102
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
2022-03-17 19:15:42 -04:00
Richard Lau eca0dd981b Working on v12.22.12
PR-URL: https://github.com/nodejs/node/pull/42363
2022-03-17 19:13:58 -04:00
Richard Lau cdb72ea5d9 2022-03-17, Version 12.22.11 'Erbium' (LTS)
This is a security release.

Notable changes:

Update to OpenSSL 1.1.1n, which addresses the following vulnerability:
- Infinite loop in BN_mod_sqrt() reachable when parsing certificates (High)(CVE-2022-0778)
  More details are available at https://www.openssl.org/news/secadv/20220315.txt

Fix for building Node.js 12.x with Visual Studio 2019 to allow us to continue to
run CI tests.

PR-URL: https://github.com/nodejs/node/pull/42363
v12.22.11
2022-03-16 19:32:07 -04:00
Richard Lau c372ec207d deps: update archs files for OpenSSL-1.1.n
After an OpenSSL source update, all the config files need to be
regenerated and committed by:
    $ make -C deps/openssl/config
    $ git add deps/openssl/config/archs
    $ git add deps/openssl/openssl/include/crypto/bn_conf.h
    $ git add deps/openssl/openssl/include/crypto/dso_conf.h
    $ git add deps/openssl/openssl/include/openssl/opensslconf.h
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/42348
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-March/000218.html
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joe Sepi <sepi@joesepi.com>
2022-03-16 11:36:21 -04:00
Richard Lau d574a1dccb deps: upgrade openssl sources to 1.1.1n
This updates all sources in deps/openssl/openssl by:
    $ cd deps/openssl/
    $ rm -rf openssl
    $ tar zxf ~/tmp/openssl-1.1.1n.tar.gz
    $ mv openssl-1.1.1n openssl
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/42348
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-March/000218.html
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joe Sepi <sepi@joesepi.com>
2022-03-16 11:36:20 -04:00
Richard Lau e3e5bf11ba build: pin Windows GitHub runner to windows-2019
GitHub is removing the Windows 2016 runner image on March 15, 2022.

Refs: https://github.blog/changelog/2021-10-19-github-actions-the-windows-2016-runner-image-will-be-removed-from-github-hosted-runners-on-march-15-2022/

PR-URL: https://github.com/nodejs/node/pull/42349
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-03-16 11:36:20 -04:00
Richard Lau f41e7771bf build: fix detection of Visual Studio 2019
If Visual Studio 2017 is not found, attempt to find Visual Studio 2019.

PR-URL: https://github.com/nodejs/node/pull/42349
Refs: https://github.blog/changelog/2021-10-19-github-actions-the-windows-2016-runner-image-will-be-removed-from-github-hosted-runners-on-march-15-2022/
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-03-16 11:36:20 -04:00
Ruy Adorno 390189173f Working on v12.22.11
PR-URL: https://github.com/nodejs/node/pull/41710
2022-02-01 15:03:27 -05:00
Ruy Adorno 60c9d3bb95 2022-02-01, Version 12.22.10 'Erbium' (LTS)
Notable changes:

* Upgrade npm to 6.14.16
* Updated ICU time zone data

PR-URL: https://github.com/nodejs/node/pull/41710
v12.22.10
2022-01-26 16:11:43 -05:00
Ruy Adorno 33899b435d deps: upgrade npm to 6.14.16
PR-URL: https://github.com/nodejs/node/pull/41601
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-01-26 12:57:48 -05:00
Albert Wang d9237c46ca tools: update tzdata to 2021a4
This updates the time zone database up to 2021a4 for the node
v12.x-staging branch, following the documentation at
https://github.com/nodejs/node/blob/master/doc/guides/maintaining-icu.md#time-zone-data

This is essentially a backport of https://github.com/nodejs/node/pull/40658.

Refs: https://github.com/nodejs/node/pull/40658
Refs: https://github.com/nodejs/Release/issues/576

PR-URL: https://github.com/nodejs/node/pull/41443
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
2022-01-26 12:45:47 -05:00
Richard Lau 91d0e57100 Working on v12.22.10
PR-URL: https://github.com/nodejs-private/node-private/pull/309
2022-01-10 22:46:07 +00:00
Richard Lau 4e44cbfba6 2022-01-10, Version 12.22.9 'Erbium' (LTS)
This is a security release.

Notable changes:

Improper handling of URI Subject Alternative Names (Medium)(CVE-2021-44531)
- Accepting arbitrary Subject Alternative Name (SAN) types, unless a PKI
is specifically defined to use a particular SAN type, can result in
bypassing name-constrained intermediates. Node.js was accepting URI SAN
types, which PKIs are often not defined to use. Additionally, when a
protocol allows URI SANs, Node.js did not match the URI correctly.
- Versions of Node.js with the fix for this disable the URI SAN type when
checking a certificate against a hostname. This behavior can be
reverted through the `--security-revert` command-line option.
- More details will be available at
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531

Certificate Verification Bypass via String Injection (Medium)(CVE-2021-44532)
- Node.js converts SANs (Subject Alternative Names) to a string format.
It uses this string to check peer certificates against hostnames when
validating connections. The string format was subject to an injection
vulnerability when name constraints were used within a certificate
chain, allowing the bypass of these name constraints.
- Versions of Node.js with the fix for this escape SANs containing the
problematic characters in order to prevent the injection. This
behavior can be reverted through the `--security-revert` command-line
option.
- More details will be available at
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532

Incorrect handling of certificate subject and issuer fields (Medium)(CVE-2021-44533)
- Node.js did not handle multi-value Relative Distinguished Names
correctly. Attackers could craft certificate subjects containing a
single-value Relative Distinguished Name that would be interpreted as a
multi-value Relative Distinguished Name, for example, in order to inject
a Common Name that would allow bypassing the certificate subject
verification.
- Affected versions of Node.js do not accept multi-value Relative
Distinguished Names and are thus not vulnerable to such attacks
themselves. However, third-party code that uses node's ambiguous
presentation of certificate subjects may be vulnerable.
- More details will be available at
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44533

Prototype pollution via `console.table` properties (Low)(CVE-2022-21824)
- Due to the formatting logic of the `console.table()` function it was
not safe to allow user controlled input to be passed to the `properties`
parameter while simultaneously passing a plain object with at least one
property as the first parameter, which could be `__proto__`. The
prototype pollution has very limited control, in that it only allows an
empty string to be assigned numerical keys of the object prototype.
- Versions of Node.js with the fix for this use a null protoype for the
object these properties are being assigned to.
- More details will be available at
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21824

PR-URL: https://github.com/nodejs-private/node-private/pull/309
v12.22.9
2022-01-09 15:28:23 +00:00
Michael DawsonandAkshay K a5c7843cab src: add cve reverts and associated tests
Co-authored-by: Akshay K <iit.akshay@gmail.com>
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/306
PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-07 16:31:19 +00:00
Tobias NießenandAkshay K 8c2db2c86b tls: fix handling of x509 subject and issuer
When subject and verifier are represented as strings, escape special
characters (such as '+') to guarantee unambiguity. Previously, different
distinguished names could result in the same string when encoded. In
particular, inserting a '+' in a single-value Relative Distinguished
Name (e.g., L or OU) would produce a string that is indistinguishable
from a multi-value Relative Distinguished Name. Third-party code that
correctly interprets the generated string representation as a
multi-value Relative Distinguished Name could then be vulnerable to an
injection attack, e.g., when an attacker includes a single-value RDN
with type OU and value 'HR + CN=example.com', the string representation
produced by unpatched versions of Node.js would be
'OU=HR + CN=example.com', which represents a multi-value RDN.

Node.js itself is not vulnerable to this attack because the current
implementation that parses such strings into objects does not handle '+'
at all. This oversight leads to incorrect results, but at the same time
appears to prevent injection attacks (as described above).

With this change, the JavaScript objects representing the subject and
issuer Relative Distinguished Names are constructed in C++ directly,
instead of (incorrectly) encoding them as strings and then (incorrectly)
decoding the strings in JavaScript.

This addresses CVE-2021-44533.

Co-authored-by: Akshay K <iit.akshay@gmail.com>
CVE-ID: CVE-2021-44533
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/306
PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-07 16:31:13 +00:00
Tobias NießenandAkshay K e0fe6a635e tls: drop support for URI alternative names
Previously, Node.js incorrectly accepted uniformResourceIdentifier (URI)
subject alternative names in checkServerIdentity regardless of the
application protocol. This was incorrect even in the most common cases.
For example, RFC 2818 specifies (and RFC 6125 confirms) that HTTP over
TLS only uses dNSName and iPAddress subject alternative names, but not
uniformResourceIdentifier subject alternative names.

Additionally, name constrained certificate authorities might not be
constrained to specific URIs, allowing them to issue certificates for
URIs that specify hosts that they would not be allowed to issue dNSName
certificates for.

Even for application protocols that make use of URI subject alternative
names (such as SIP, see RFC 5922), Node.js did not implement the
required checks correctly, for example, because checkServerIdentity
ignores the URI scheme.

As a side effect, this also fixes an edge case. When a hostname is not
an IP address and no dNSName subject alternative name exists, the
subject's Common Name should be considered even when an iPAddress
subject alternative name exists.

It remains possible for users to pass a custom checkServerIdentity
function to the TLS implementation in order to implement custom identity
verification logic.

This addresses CVE-2021-44531.

Co-authored-by: Akshay K <iit.akshay@gmail.com>
CVE-ID: CVE-2021-44531
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/306
PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-07 16:31:04 +00:00
Tobias NießenandAkshay K 19873abfb2 crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even though they
were not valid for the target hostname.

These changes affect the format of subject alternative names and the
format of authority information access. The checkServerIdentity function
has been modified to safely handle the new format, eliminating the
possibility of injecting subject alternative names into the verification
logic.

Because each subject alternative name is only encoded as a JSON string
literal if necessary for security purposes, this change will only be
visible in rare cases.

This addresses CVE-2021-44532.

Co-authored-by: Akshay K <iit.akshay@gmail.com>
CVE-ID: CVE-2021-44532
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/306
PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-07 16:30:54 +00:00
Tobias NießenandAkshay K d4e5d1b9ca src: remove unused x509 functions
These functions are currently not being used and their security should
be audited before any potential future use.

Co-authored-by: Akshay K <iit.akshay@gmail.com>
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/306
PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-07 16:30:46 +00:00
Tobias Nießen be69403528 console: fix prototype pollution via console.table
CVE-ID: CVE-2022-21824
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/308
PR-URL: https://github.com/nodejs-private/node-private/pull/307
Refs: https://hackerone.com/reports/1431042
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-01-07 12:04:42 +00:00
Richard Lau ff9ac7d757 doc: fix date for v12.22.8
PR-URL: https://github.com/nodejs/node/pull/41213
Refs: https://github.com/nodejs/node/pull/41161
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-17 12:06:58 +00:00
Richard Lau 3a7af72bd4 Working on v12.22.9
PR-URL: https://github.com/nodejs/node/pull/41161
2021-12-16 23:30:52 +00:00
Richard Lau 8b61500d72 2012-12-16, Version 12.22.8 'Erbium' (LTS)
Notable changes:
This release contains a c-ares update to fix a regression introduced in
Node.js 12.22.5 resolving CNAME records containing underscores
(https://github.com/nodejs/node/issues/39780).

Root certificates have been updated to those from Mozilla's Network
Security Services 3.71 (https://github.com/nodejs/node/pull/40280).

PR-URL: https://github.com/nodejs/node/pull/41161
v12.22.8
2021-12-15 17:25:18 +00:00
Richard Lau 4c9f920d34 deps: update archs files for OpenSSL-1.1.1m
After an OpenSSL source update, all the config files need to be
regenerated and committed by:
    $ make -C deps/openssl/config
    $ git add deps/openssl/config/archs
    $ git add deps/openssl/openssl/include/crypto/bn_conf.h
    $ git add deps/openssl/openssl/include/crypto/dso_conf.h
    $ git add deps/openssl/openssl/include/openssl/opensslconf.h
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/41172
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000211.html
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-12-15 17:21:06 +00:00
Richard Lau 60d7d4171e deps: upgrade openssl sources to 1.1.1m
This updates all sources in deps/openssl/openssl by:
    $ cd deps/openssl/
    $ rm -rf openssl
    $ tar zxf ~/tmp/openssl-1.1.1m.tar.gz
    $ mv openssl-1.1.1m openssl
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/41172
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000211.html
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-12-15 17:20:58 +00:00
Francesco Trotta 243b2fbfdb lib: fix regular expression to detect / and \
PR-URL: https://github.com/nodejs/node/pull/40325
Backport-PR-URL: https://github.com/nodejs/node/pull/40565
Fixes: https://github.com/nodejs/node/issues/40305
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2021-12-14 15:35:05 +00:00
Anna Henningsen 02b432a704 src: fix crash in AfterGetAddrInfo
Remove invalid usage of `Check()`. This addresses:

    FATAL ERROR: v8::FromJust Maybe value is Nothing.
     1: 0x101311bf5 node::Abort() (.cold.1) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     2: 0x1000ade29 node::Abort() [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     3: 0x1000adf8f node::OnFatalError(char const*, char const*) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     4: 0x1001f42d0 v8::V8::FromJustIsNothing() [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     5: 0x1000268e2 node::cares_wrap::(anonymous namespace)::AfterGetAddrInfo(uv_getaddrinfo_s*, int, addrinfo*)::$_2::operator()(bool, bool) const [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     6: 0x10002657c node::cares_wrap::(anonymous namespace)::AfterGetAddrInfo(uv_getaddrinfo_s*, int, addrinfo*) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     7: 0x1009fb388 uv__work_done [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     8: 0x100a00453 uv__async_io [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
     9: 0x100a140cc uv__io_poll [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
    10: 0x100a009c1 uv_run [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
    11: 0x10014aca0 node::worker::Worker::Run() [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
    12: 0x10014e56f node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node]
    13: 0x7fff703d42eb _pthread_body [/usr/lib/system/libsystem_pthread.dylib]
    14: 0x7fff703d7249 _pthread_start [/usr/lib/system/libsystem_pthread.dylib]
    15: 0x7fff703d340d thread_start [/usr/lib/system/libsystem_pthread.dylib]

PR-URL: https://github.com/nodejs/node/pull/39735
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-12-14 15:32:22 +00:00
Anna Henningsen 41e09ec71b child_process: retain reference to data with advanced serialization
Do the same thing we do for other streams, and retain a reference to
the Buffer that was sent over IPC while the write request is active,
so that it doesn’t get garbage collected while the data is still in
flight.

(This is a good example of why it’s a bad idea that we’re not re-using
the general streams implementation for IPC and instead maintain
separate usage of the low-level I/O primitives.)

Fixes: https://github.com/nodejs/node/issues/34797

PR-URL: https://github.com/nodejs/node/pull/38728
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-12-14 15:32:22 +00:00
Santiago Gimeno f50b9c1e8a worker: avoid potential deadlock on NearHeapLimit
It can happen that the `NearHeapLimit` callback is called while calling
the `oninit()` function on `MessagePort` construction causing a deadlock
when the `Worker::Exit()` method is called, as the `mutex_` was already
held on the `CreateEnvMessagePort()` method. To fix it, just use the
`mutex_` to protect the `child_port_data_` variable and avoid holding it
when creating the `MessagePort`.
Also, return early from `Worker::Run()` if the worker message port
could not be created.

Fixes: https://github.com/nodejs/node/issues/38208

PR-URL: https://github.com/nodejs/node/pull/38403
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2021-12-14 15:32:22 +00:00
Anna Henningsen 70e094a26b repl: fix error message printing
The REPL implementation would strip away the first and last character
of a formatted error message if it ended with `]` (but with the
obviously missing check for a starting `]`), leading to things like
`Uncaught rror: foo[a` being printed for input like `Error: foo[a]`.

Refs: https://github.com/nodejs/node/pull/22436

PR-URL: https://github.com/nodejs/node/pull/38209
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-14 15:32:15 +00:00
Richard Lau f0be07796e crypto: update root certificates
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl.

Certificates added:
- Trustwave Global Certification Authority
- Trustwave Global ECC P256 Certification Authority
- Trustwave Global ECC P384 Certification Authority
- NAVER Global Root Certification Authority
- AC RAIZ FNMT-RCM SERVIDORES SEGUROS
- GlobalSign Root R46
- GlobalSign Root E46
- GLOBALTRUST 2020
- ANF Secure Server Root CA
- Certum EC-384 CA
- Certum Trusted Root CA
- TunTrust Root CA
- HARICA TLS RSA Root CA 2021
- HARICA TLS ECC Root CA 2021

Certificates removed:
- GeoTrust Global CA
- GeoTrust Universal CA
- GeoTrust Universal CA 2
- QuoVadis Root CA
- Sonera Class 2 Root CA
- Taiwan GRCA
- GeoTrust Primary Certification Authority
- thawte Primary Root CA
- VeriSign Class 3 Public Primary Certification Authority - G5
- OISTE WISeKey Global Root GA CA
- GeoTrust Primary Certification Authority - G3
- thawte Primary Root CA - G2
- thawte Primary Root CA - G3
- GeoTrust Primary Certification Authority - G2
- VeriSign Universal Root Certification Authority
- VeriSign Class 3 Public Primary Certification Authority - G4
- Chambers of Commerce Root - 2008
- Global Chambersign Root - 2008
- Trustis FPS Root CA
- EE Certification Centre Root CA
- Staat der Nederlanden Root CA - G3

PR-URL: https://github.com/nodejs/node/pull/40280
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-12-13 19:50:11 +00:00
Richard Lau 833e199393 tools: update certdata.txt
This is the certdata.txt[0] from NSS 3.71, released on 2021-09-30.

This is the version of NSS that will ship in Firefox 94 on
2021-11-02.

[0] https://hg.mozilla.org/projects/nss/raw-file/NSS_3_71_RTM/lib/ckfw/builtins/certdata.txt

PR-URL: https://github.com/nodejs/node/pull/40280
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-12-13 19:50:11 +00:00
Daniel Bevenius 7feff67419 deps: add -fno-strict-aliasing flag to libuv
This commit turns on `-fno-strict-aliasing` in libuv.

Fixes: https://github.com/nodejs/node/issues/40368
Refs: https://github.com/libuv/libuv/issues/1230

PR-URL: https://github.com/nodejs/node/pull/40631
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-13 12:25:38 -05:00
Richard Lau 2d42295d2a build: pin macOS GitHub runner to macos-10.15
Node.js 12.x requires Python 2 to build. `macos-latest` GitHub
hosted runners are now macOS 11 and do not have Python 2 available.

PR-URL: https://github.com/nodejs/node/pull/41124
Refs: https://github.com/actions/virtual-environments/issues/4060
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-12-13 08:06:07 -05:00
Filip Skokan b13340eff4 doc: add alternative version links to the packages page
PR-URL: https://github.com/nodejs/node/pull/36915
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2021-12-09 13:35:12 +00:00
Richard Lau 534ac7c7c6 deps: update c-ares to 1.18.1
Updated as described in doc/guides/maintaining-c-ares.md.

PR-URL: https://github.com/nodejs/node/pull/40660
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-12-09 13:14:35 +00:00