RafaelGSS
d8ccfe9ad4
policy: handle Module.constructor and main.extensions bypass
...
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com >
PR-URL: https://github.com/nodejs-private/node-private/pull/445
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1960870
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=2043807
CVE-ID: CVE-2023-32002,CVE-2023-32006
2023-08-08 10:00:22 -03:00
Tobias Nießen
242aaa0caa
policy: disable process.binding() when enabled
...
process.binding() can be used to trivially bypass restrictions imposed
through a policy. Since the function is deprecated already, simply
replace it with a stub when a policy is being enabled.
Fixes: https://hackerone.com/bugs?report_id=1946470
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
CVE-ID: CVE-2023-32559
PR-URL: https://github.com/nodejs-private/node-private/pull/459
2023-08-08 09:59:12 -03:00
Tobias Nießen
5a92ea7a3b
crypto: handle cert with invalid SPKI gracefully
...
When attempting to convert the SPKI of a X509Certificate to a KeyObject,
throw an error if the subjectPublicKey cannot be parsed instead of
aborting the process.
Fixes: https://hackerone.com/bugs?report_id=1884159
PR-URL: https://github.com/nodejs-private/node-private/pull/393/
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
CVE-ID: CVE-2023-30588
2023-06-19 15:50:27 -03:00
Paolo Insogna
e42ff4b018
http: disable request smuggling via empty headers
...
PR-URL: https://github.com/nodejs-private/node-private/pull/429
Refs: https://github.com/nodejs-private/node-private/pull/427
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
CVE-ID: CVE-2023-30589
2023-06-19 09:21:06 -03:00
Tobias Nießen
1a5c9284eb
doc,test: clarify behavior of DH generateKeys
...
The DiffieHellman class is an old and thin wrapper around certain
OpenSSL functions, many of which are deprecated in OpenSSL 3.0. Because
the Node.js API mirrors the OpenSSL API, it adopts some of its
peculiarities, but the Node.js documentation does not properly reflect
these. Most importantly, despite the documentation saying otherwise,
diffieHellman.generateKeys() does not generate a new private key when
one has already been set or generated. Based on the documentation alone,
users may be led to misuse the API in a way that results in key reuse,
which can have drastic negative consequences for subsequent operations
that consume the shared secret.
These design issues in this old API have been around for many years, and
we are not currently aware of any misuse in the ecosystem that falls
into the above scenario. Changing the behavior of the API would be a
significant breaking change and is thus not appropriate for a security
release (nor is it a goal.) The reported issue is treated as CWE-1068
(after a vast amount of uncertainty whether to treat it as a
vulnerability at all), therefore, this change only updates the
documentation to match the actual behavior. Tests are also added that
demonstrate this particular oddity.
Newer APIs exist that can be used for some, but not all, Diffie-Hellman
operations (e.g., crypto.diffieHellman() that was added in 2020). We
should keep modernizing crypto APIs, but that is a non-goal for this
security release.
The ECDH class mirrors the DiffieHellman class in many ways, but it does
not appear to be affected by this particular peculiarity. In particular,
ecdh.generateKeys() does appear to always generate a new private key.
PR-URL: https://github.com/nodejs-private/node-private/pull/426
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
CVE-ID: CVE-2023-30590
2023-06-19 09:21:06 -03:00
RafaelGSS
a6f4e87bc9
policy: handle mainModule.__proto__ bypass
...
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/418
PR-URL: https://github.com/nodejs-private/node-private/pull/416
Fixes: https://hackerone.com/bugs?subject=nodejs&report_id=1877919
Reviewed-By: Rich Trott <rtrott@gmail.com >
CVE-ID: CVE-2023-30581
2023-06-19 09:20:33 -03:00
Vita Batrla
d081032a60
test: fix test-net-connect-reset-until-connected
...
Fixes: https://github.com/nodejs/node/issues/43446
PR-URL: https://github.com/nodejs/node/pull/46781
Reviewed-By: theanarkh <theratliter@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-03-27 17:28:54 +01:00
Rich Trott
086bb2f8d4
Revert "src: let http2 streams end after session close"
...
This reverts commit dee882e94f .
Moved the test that demonstrated what this commit was fixing to the
`known_issues` folder.
Fixes: https://github.com/nodejs/node/issues/46234
PR-URL: https://github.com/nodejs/node/pull/46721
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2023-03-27 16:41:21 +01:00
Richard Lau and Anna Henningsen
de6dd67790
crypto: avoid hang when no algorithm available
...
Avoid an endless loop if no algorithm is available to seed the
cryptographically secure pseudorandom number generator (CSPRNG).
Co-authored-by: Anna Henningsen <anna@addaleax.net >
PR-URL: https://github.com/nodejs/node/pull/46237
Fixes: https://github.com/nodejs/node/issues/46200
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2023-03-27 13:03:21 +01:00
Ben Noordhuis
4617512788
crypto: ensure auth tag set for chacha20-poly1305
...
Because OpenSSL v1.x doesn't do that by itself (OpenSSL v3.x does.)
Fixes: https://github.com/nodejs/node/issues/45874
PR-URL: https://github.com/nodejs/node/pull/46185
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-03-27 13:02:52 +01:00
MURAKAMI Masahiko
809371a15f
module: require.resolve.paths returns null with node schema
...
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.
Fixes: https://github.com/nodejs/node/issues/45001
PR-URL: https://github.com/nodejs/node/pull/45147
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2023-03-27 13:02:09 +01:00
Antoine du Hamel
efe1be47ec
test: skip test depending on overlapped-checker when not available
...
PR-URL: https://github.com/nodejs/node/pull/45015
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-03-27 13:01:47 +01:00
Richard Lau
908c4dff44
test: mark test-crypto-key-objects flaky on Linux
...
PR-URL: https://github.com/nodejs/node/pull/46684
Refs: https://github.com/nodejs/node/issues/46683
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com >
2023-02-18 21:46:01 -05:00
RafaelGSS and Bradley Farias
b02d895137
policy: makeRequireFunction on mainModule.require
...
Co-authored-by: Bradley Farias <bradley.meck@gmail.com >
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/372
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1747642
CVE-ID: CVE-2023-23918
PR-URL: https://github.com/nodejs-private/node-private/pull/358
Reviewed-by: Bradley Farias <bradley.meck@gmail.com >
Reviewed-by: Michael Dawson <midawson@redhat.com >
2023-02-15 18:08:34 +00:00
RafaelGSS
b558e9f476
crypto: clear OpenSSL error on invalid ca cert
...
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com >
CVE-ID: CVE-2023-23919
PR-URL: https://github.com/nodejs-private/node-private/pull/375
Refs: https://hackerone.com/bugs?report_id=1808596
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2023-02-14 17:00:17 +00:00
Filip Skokan
160adb7ffc
crypto: clear OpenSSL error queue after calling X509_check_private_key()
...
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/375
CVE-ID: CVE-2023-23919
Fixes: https://github.com/nodejs/node/issues/45485
PR-URL: https://github.com/nodejs/node/pull/45495
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1808596
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2023-02-14 16:59:57 +00:00
Takuro Sato
d0ece30948
crypto: clear OpenSSL error queue after calling X509_verify()
...
Prior to this commit, functions accessing the OpenSSL error queue did
not work properly after x509.verify() returned false.
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/375
CVE-ID: CVE-2023-23919
PR-URL: https://github.com/nodejs/node/pull/45377
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1808596
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
2023-02-14 16:58:41 +00:00
Richard Lau
d7f83c420c
test: avoid left behind child processes
...
Extend the Linux logic to all POSIX platforms in
test-child-process-exec-abortcontroller-promisified.
PR-URL: https://github.com/nodejs/node/pull/46276
Fixes: https://github.com/nodejs/build/issues/3154
Refs: https://github.com/nodejs/node/issues/37518
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com >
Reviewed-By: Ruy Adorno <ruyadorno@google.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-01-22 14:20:29 -05:00
Joyee Cheung
fbc52e5729
src: disambiguate terms used to refer to builtins and addons
...
The term "native module" dates back to some of the oldest code
in the code base. Within the context of Node.js core it usually
refers to modules that are native to Node.js (e.g. fs, http),
but it can cause confusion for people who don't work on this
part of the code base, as "native module" can also refer to
native addons - which is even the case in some of the API
docs and error messages.
This patch tries to make the usage of these terms more consistent.
Now within the context of Node.js core:
- JavaScript scripts that are built-in to Node.js are now referred
to as "built-in(s)". If they are available as modules,
they can also be referred to as "built-in module(s)".
- Dynamically-linked shared objects that are loaded into
the Node.js processes are referred to as "addons".
We will try to avoid using the term "native modules" because it could
be ambiguous.
Changes in this patch:
File names:
- node_native_module.h -> node_builtins.h,
- node_native_module.cc -> node_builtins.cc
C++ binding names:
- `native_module` -> `builtins`
`node::Environment`:
- `native_modules_without_cache` -> `builtins_without_cache`
- `native_modules_with_cache` -> `builtins_with_cache`
- `native_modules_in_snapshot` -> `builtins_in_cache`
- `native_module_require` -> `builtin_module_require`
`node::EnvSerializeInfo`:
- `native_modules` -> `builtins
`node::native_module::NativeModuleLoader`:
- `native_module` namespace -> `builtins` namespace
- `NativeModuleLoader` -> `BuiltinLoader`
- `NativeModuleRecordMap` -> `BuiltinSourceMap`
- `NativeModuleCacheMap` -> `BuiltinCodeCacheMap`
- `ModuleIds` -> `BuiltinIds`
- `ModuleCategories` -> `BuiltinCategories`
- `LoadBuiltinModuleSource` -> `LoadBuiltinSource`
`loader.js`:
- `NativeModule` -> `BuiltinModule` (the `NativeModule` name used in
`process.moduleLoadList` is kept for compatibility)
And other clarifications in the documentation and comments.
PR-URL: https://github.com/nodejs/node/pull/44135
Backport-PR-URL: https://github.com/nodejs/node/pull/45663
Fixes: https://github.com/nodejs/node/issues/44036
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2022-12-08 09:55:24 -05:00
Santiago Gimeno
953072d3db
src: let http2 streams end after session close
...
After the stream has been marked as closed by the nghttp2 stack, there
might be still pending data to be sent: trailing headers is an example
of this. In that case, avoid reentering the nghttp2 stack synchronously
to allow the data to be written before actually closing the stream.
Fixes: https://github.com/nodejs/node/issues/42713
PR-URL: https://github.com/nodejs/node/pull/45153
Backport-PR-URL: https://github.com/nodejs/node/pull/45660
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2022-12-08 09:19:00 -05:00
Richard Lau
6733556783
test: add test to validate changelogs for releases
...
Add a new test to check that the changelog files have been correctly
updated for releases.
PR-URL: https://github.com/nodejs/node/pull/45325
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2022-12-07 11:11:10 -05:00
Moshe Atlow
64d343af74
test_runner: support using --inspect with --test
...
PR-URL: https://github.com/nodejs/node/pull/44520
Backport-PR-URL: https://github.com/nodejs/node/pull/44873
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-12-07 09:05:04 -05:00
Moshe Atlow
37e909251c
test_runner: support programmatically running --test
...
PR-URL: https://github.com/nodejs/node/pull/44241
Backport-PR-URL: https://github.com/nodejs/node/pull/44873
Fixes: https://github.com/nodejs/node/issues/44023
Fixes: https://github.com/nodejs/node/issues/43675
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-12-07 09:04:55 -05:00
Darshan Sen
197df63f74
test: add a test to ensure the correctness of timezone upgrades
...
Currently, there's no way to know if a timezone upgrade PR is correct
without building and testing the change locally. This change provides a
solution for that.
Tested in https://github.com/RaisinTen/node/pull/4 .
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/45299
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-11-24 10:48:27 -05:00
theanarkh
33707dcd03
dgram: add dgram send queue info
...
PR-URL: https://github.com/nodejs/node/pull/44149
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2022-11-24 10:26:20 -05:00
Manuel Spigolon
8c73279ebb
util: add default value option to parsearg
...
Users can set a default
value for every expected
input argument
PR-URL: https://github.com/nodejs/node/pull/44631
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-11-24 09:28:33 -05:00
legendecas
54608d8dc3
src: split property helpers from node::Environment
...
PR-URL: https://github.com/nodejs/node/pull/44056
Backport-PR-URL: https://github.com/nodejs/node/pull/44542
Refs: https://github.com/nodejs/node/issues/42528
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-11-24 07:27:20 -05:00
Richard Lau
42e9d8016a
test: fix textdecoder test for small-icu builds
...
The `Shift_JIS` encoding may not be available, e.g. when Node.js is
configured with `--with-intl=small-icu`.
PR-URL: https://github.com/nodejs/node/pull/45225
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com >
2022-11-23 21:42:56 -05:00
Moshe Atlow
543d3d2bf3
test: deflake watch mode tests
...
PR-URL: https://github.com/nodejs/node/pull/44621
Backport-PR-URL: https://github.com/nodejs/node/pull/44976
Fixes: https://github.com/nodejs/node/issues/44655
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-11-23 14:47:16 -05:00
Moshe Atlow
97f6caf4eb
test: split watch mode inspector tests to sequential
...
PR-URL: https://github.com/nodejs/node/pull/44551
Backport-PR-URL: https://github.com/nodejs/node/pull/44976
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com >
2022-11-23 14:47:05 -05:00
Moshe Atlow
1e0dcd1ee0
cli: add --watch
...
PR-URL: https://github.com/nodejs/node/pull/44366
Backport-PR-URL: https://github.com/nodejs/node/pull/44976
Fixes: https://github.com/nodejs/node/issues/40429
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-11-23 14:46:59 -05:00
Antoine du Hamel
254358c81e
tools: refactor avoid-prototype-pollution lint rule
...
The lint rule was not catching all occurences of unsafe primordials use,
and was too strict on some methods.
PR-URL: https://github.com/nodejs/node/pull/43476
Backport-PR-URL: https://github.com/nodejs/node/pull/44926
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-11-23 12:07:03 -05:00
Filip Skokan
317cd051ce
crypto: allow zero-length IKM in HKDF and in webcrypto PBKDF2
...
PR-URL: https://github.com/nodejs/node/pull/44201
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Backport-PR-URL: https://github.com/nodejs/node/pull/44872
2022-10-11 14:45:30 -05:00
Filip Skokan
e5c9975f11
crypto: allow zero-length secret KeyObject
...
PR-URL: https://github.com/nodejs/node/pull/44201
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Backport-PR-URL: https://github.com/nodejs/node/pull/44872
2022-10-11 14:45:30 -05:00
Filip Skokan
7e705d8d74
crypto: fix webcrypto deriveBits validations
...
PR-URL: https://github.com/nodejs/node/pull/44173
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Backport-PR-URL: https://github.com/nodejs/node/pull/44872
2022-10-11 14:45:30 -05:00
Filip Skokan
7ad2a268b9
crypto: fix webcrypto EC key namedCurve validation errors
...
PR-URL: https://github.com/nodejs/node/pull/44172
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Backport-PR-URL: https://github.com/nodejs/node/pull/44872
2022-10-11 14:45:30 -05:00
Filip Skokan
2c938d73ff
crypto: fix webcrypto operation errors to be OperationError
...
PR-URL: https://github.com/nodejs/node/pull/44171
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Backport-PR-URL: https://github.com/nodejs/node/pull/44872
2022-10-11 14:45:30 -05:00
Filip Skokan
a6e2cb40a6
crypto: fix webcrypto generateKey() AES key length validation error
...
PR-URL: https://github.com/nodejs/node/pull/44170
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Backport-PR-URL: https://github.com/nodejs/node/pull/44872
2022-10-11 14:45:30 -05:00
Connor Burton
fada3a2ce7
test: add extra tests for basename with ext option
...
PR-URL: https://github.com/nodejs/node/pull/44772
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-11 14:45:29 -05:00
Paolo Insogna
2cee039070
http: disable chunked encoding when OBS fold is used
...
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com >
PR-URL: #341
CVE-ID: CVE-2022-32213, CVE-2022-32215, CVE-2022-35256
2022-10-11 14:45:28 -05:00
sidwebworks
2cd2f56962
http: throw error on content-length mismatch
...
PR-URL: https://github.com/nodejs/node/pull/44378
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2022-10-11 14:45:26 -05:00
smitley
aae8ff6ace
test: fix test-performance-measure
...
Refs: https://github.com/nodejs/node/issues/42949
Looking at the documentation for setTimeout
(https://nodejs.org/api/timers.html#settimeoutcallback-delay-args )
there is no guarantee that setTimeout won't complete early.
From the failure of https://github.com/nodejs/node/issues/42949 this
is likely what happened.
I have updated the assert.ok test to allow some variation in
the test.
PR-URL: https://github.com/nodejs/node/pull/44637
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2022-10-11 14:45:26 -05:00
MURAKAMI Masahiko
f13e06ab85
test: improve lib/readline.js coverage
...
PR-URL: https://github.com/nodejs/node/pull/42686
Refs: https://coverage.nodejs.org/coverage-a0461255c05c79cf/lib/readline.js.html#L105
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-10-11 14:45:26 -05:00
Tobias Nießen
debf7301aa
lib,test: fix bug in InternalSocketAddress
...
InternalSocketAddress must set [kDetails] in order for the inherited
properties to function correctly.
Co-authored-by: Tobias Nießen <tniessen@tnie.de >
PR-URL: https://github.com/nodejs/node/pull/44618
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-10-11 14:45:25 -05:00
Antoine du Hamel
a46dd370d7
test: fix test-repl not validating leaked globals properly
...
PR-URL: https://github.com/nodejs/node/pull/44640
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2022-10-11 14:45:25 -05:00
StefanStojanovic
8d259e6086
win: fix fs.realpath.native for long paths
...
Unlike other fs.js functions that work with paths, realpath.native isn't
using pathModule.toNamespacedPath prior to calling libuv function. This
is causing issues on windows.
Windows long path test is also improved to cover the mentioned issue.
Fixes: https://github.com/nodejs/node/issues/39721
PR-URL: https://github.com/nodejs/node/pull/44536
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
2022-10-11 14:45:24 -05:00
Chengzhong Wu
4e49d5d1b4
inspector: expose inspector.close on workers
...
Workers can open their own inspector agent with `inspector.open`.
They should be able to close their own inspector agent too with
`inspector.close`.
PR-URL: https://github.com/nodejs/node/pull/44489
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2022-10-11 14:45:24 -05:00
Tobias Nießen
1fc6394741
crypto: restrict PBKDF2 args to signed int
...
OpenSSL internally represents the output length and the iteration count
as signed integers, which is why node's C++ implementation expects these
arguments to fit into signed integers as well. The JavaScript validation
logic, however, only requires the arguments to be unsigned 32-bit
integers, which is a superset of non-negative (signed) 32-bit integers.
Change the JavaScript validation to match the expectation within C++.
Fixes: https://github.com/nodejs/node/issues/44570
PR-URL: https://github.com/nodejs/node/pull/44575
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2022-10-11 14:45:23 -05:00
Luigi Pinca
370b0ec5a1
test: use python3 instead of python
...
On some platforms, such as macOS, the `python` command is no longer
available by default.
PR-URL: https://github.com/nodejs/node/pull/44545
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2022-10-11 14:45:23 -05:00
Daeyeon Jeong
6ed3367155
stream: add ReadableByteStream.tee()
...
This supports teeing readable byte streams to meet
the latest web streams standards.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/44505
Refs: https://streams.spec.whatwg.org/#readable-stream-tee
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-10-11 14:45:23 -05:00