Antoine du Hamel
812140c65a
tools,doc: add guards against prototype pollution when creating proxies
...
PR-URL: https://github.com/nodejs/node/pull/43391
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
2022-06-15 21:28:48 -04:00
Antoine du Hamel
ac9599a718
tools: report unsafe string and regex primordials as lint errors
...
| The string method | looks up the property |
| ----------------------------- | --------------------- |
| `String.prototype.match` | `Symbol.match` |
| `String.prototype.matchAll` | `Symbol.matchAll` |
| `String.prototype.replace` | `Symbol.replace` |
| `String.prototype.replaceAll` | `Symbol.replace` |
| `String.prototype.search` | `Symbol.search` |
| `String.prototype.split` | `Symbol.split` |
Functions that lookup the `exec` property on the prototype chain:
* `RegExp.prototype[Symbol.match]`
* `RegExp.prototype[Symbol.matchAll]`
* `RegExp.prototype[Symbol.replace]`
* `RegExp.prototype[Symbol.search]`
* `RegExp.prototype[Symbol.split]`
* `RegExp.prototype.test`
`RegExp.prototype[Symbol.replace]` and `RegExp.prototype[Symbol.split]`
are still allowed for a lack of a better solution.
PR-URL: https://github.com/nodejs/node/pull/43393
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-06-15 21:28:47 -04:00
Antoine du Hamel
0bb84b09a5
dns: accept 'IPv4' and 'IPv6' for family
...
Refs: https://github.com/nodejs/node/issues/43014
PR-URL: https://github.com/nodejs/node/pull/43054
Fixes: https://github.com/nodejs/node/issues/43014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Darshan Sen <raisinten@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: Michael Dawson <midawson@redhat.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2022-06-15 21:28:47 -04:00
Filip Skokan
9f1de2c005
crypto: fix webcrypto import of cfrg raw public keys
...
PR-URL: https://github.com/nodejs/node/pull/43404
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-06-15 21:28:47 -04:00
Filip Skokan
0a075cb548
crypto: fix webcrypto JWK EC and OKP import crv check
...
PR-URL: https://github.com/nodejs/node/pull/43346
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-06-15 21:28:46 -04:00
LiviaMedeiros
56b8cc5cef
util: freeze kEnumerableProperty
...
PR-URL: https://github.com/nodejs/node/pull/43390
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Beth Griggs <bgriggs@redhat.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-06-15 21:28:46 -04:00
Daeyeon Jeong
0c5092c51c
events: fix adding abort listener in events.once
...
Event listeners passed to un/subscribe the abort event are mismatched.
This removes the wrapper function in `eventTargetAgnosticAddListener()`
and directly passes the given listener to the `EventTarget`.
IMO, removing the wrapper seems harmless, and the `AbortSignal` is
seemingly the only `EventTarget` passed to this function for now.
Fixes: https://github.com/nodejs/node/issues/43337
Refs: https://github.com/nodejs/node/pull/33659
Refs: https://github.com/nodejs/node/pull/34997
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/43373
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2022-06-15 21:28:46 -04:00
Chengzhong Wu
f7c4015fd8
bootstrap: consolidate global properties definition
...
`globalThis.process` and `globalThis.Buffer` has been re-defined with
a getter/setter pair.
`atob` and `bota` are defined as enumerable properties according to
WebIDL definition.
PR-URL: https://github.com/nodejs/node/pull/43357
Refs: https://github.com/nodejs/node/pull/26882
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2022-06-14 08:16:10 -04:00
Sergey Petushkov
66d956ca49
repl: make autocomplete case-insensitive
...
This changes autocomplete suggestion filter to ignore input case
allowing for more autosuggest results shown on the screen
Fixes: https://github.com/nodejs/node/issues/41631
PR-URL: https://github.com/nodejs/node/pull/41632
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:57 -04:00
Eugene Chapko
7e8a00a26d
readline: fix question stack overflow
...
This commit fixes readline interface's question callback wrapping when
it is being called with `signal` option. Previous version completely
overwrites passed callback and throws "Maximum call stack size exceeded"
error.
PR-URL: https://github.com/nodejs/node/pull/43320
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-06-12 20:24:57 -04:00
Kohei Ueno
112518fb1d
perf_hooks: fix function wrapped by timerify to work correctly
...
PR-URL: https://github.com/nodejs/node/pull/43330
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-06-12 20:24:57 -04:00
Antoine du Hamel
cf8a115983
tools: add avoid-prototype-pollution lint rule
...
PR-URL: https://github.com/nodejs/node/pull/43308
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-06-12 20:24:55 -04:00
LiviaMedeiros
3b2f7eed39
lib: use kEmptyObject in various places
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:55 -04:00
LiviaMedeiros
44b65d0ca7
worker: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:55 -04:00
LiviaMedeiros
7fc432fa35
wasi: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:55 -04:00
LiviaMedeiros
024b396275
vm: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:55 -04:00
LiviaMedeiros
e31baca76a
tls: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:55 -04:00
LiviaMedeiros
fecad7a3a5
timers: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:54 -04:00
LiviaMedeiros
e576a7fa50
test_runner: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:54 -04:00
LiviaMedeiros
b200a5ff67
stream: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:54 -04:00
LiviaMedeiros
5e98cacf77
readline: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:54 -04:00
LiviaMedeiros
a3310d13bf
perf_hooks: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:54 -04:00
LiviaMedeiros
b468b8fe51
https: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:54 -04:00
LiviaMedeiros
2ffd54105a
http2: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:53 -04:00
LiviaMedeiros
a4409f85f8
http: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:53 -04:00
LiviaMedeiros
63bf49b143
fs: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:53 -04:00
LiviaMedeiros
fda2105481
events: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:53 -04:00
LiviaMedeiros
df0903c8e8
crypto: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:53 -04:00
LiviaMedeiros
7b5cb14f0c
cluster: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:53 -04:00
LiviaMedeiros
4109ddc005
child_process: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:52 -04:00
LiviaMedeiros
702bfa0b7c
async_hooks: use kEmptyObject
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:52 -04:00
LiviaMedeiros
b187d55b6d
util: add kEmptyObject to internal/util
...
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:52 -04:00
Filip Skokan
6d0053345e
crypto: remove Node.js-specific webcrypto extensions
...
PR-URL: https://github.com/nodejs/node/pull/43310
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-06-12 20:24:52 -04:00
theanarkh
9803b82ac7
net,dns: move hasObserver out of perf function
...
move the hasObserver out of startPerf and stopPerf
to avoid generating useless objects when these are no observer
PR-URL: https://github.com/nodejs/node/pull/43217
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-06-12 20:24:51 -04:00
LiviaMedeiros
4a9511d971
lib: give names to promisified methods
...
Affected functions: `fs.exists`, `readline.Interface.prototype.question`
PR-URL: https://github.com/nodejs/node/pull/43218
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-06-12 20:24:48 -04:00
Filip Skokan
28c034d6b5
crypto: add CFRG curves to Web Crypto API
...
PR-URL: https://github.com/nodejs/node/pull/42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-06-12 20:24:48 -04:00
LiviaMedeiros
7f8f61a749
tls: fix performance regression in convertALPNProtocols()
...
`isUint8Array()` covers instances of `Buffer`
`isArrayBufferView()` path is cold and not worth additional check
PR-URL: https://github.com/nodejs/node/pull/43250
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2022-06-12 19:25:42 -04:00
Feng Yu
9b764531b9
fs: export constants from fs/promises
...
PR-URL: https://github.com/nodejs/node/pull/43177
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 19:25:41 -04:00
Antoine du Hamel
b8644606eb
lib: use null-prototype objects for property descriptors
...
Refs: https://github.com/nodejs/node/pull/42921
PR-URL: https://github.com/nodejs/node/pull/43270
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-06-12 19:25:41 -04:00
LiviaMedeiros
447bbd0d66
tls: fix convertALPNProtocols accepting ArrayBufferViews
...
PR-URL: https://github.com/nodejs/node/pull/43211
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-05-30 12:59:37 -04:00
theanarkh
54d68b1afd
perf_hooks: fix start_time of perf_hooks
...
PR-URL: https://github.com/nodejs/node/pull/43069
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2022-05-30 12:45:09 -04:00
Filip Skokan
920d8c5300
crypto: align webcrypto RSA key import/export with other implementations
...
closes #39959
see https://github.com/w3c/webcrypto/issues/307
see https://github.com/w3c/webcrypto/pull/305
PR-URL: https://github.com/nodejs/node/pull/42816
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-05-30 12:33:55 -04:00
ofirbarak
b187060f76
http2: set origin name correctly when servername is empty
...
Fixes: https://github.com/nodejs/node/issues/39919
Refs: https://github.com/nodejs/node/pull/39934
PR-URL: https://github.com/nodejs/node/pull/42838
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-05-30 12:33:55 -04:00
Benjamin E. Coe
d6cf409d78
util: add parseArgs module
...
Adds util.parseArgs helper for higher level command-line argument
parsing.
PR-URL: https://github.com/nodejs/node/pull/42675
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruy Adorno <ruyadorno@github.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Joe Sepi <sepi@joesepi.com >
Reviewed-By: Ian Sutherland <ian@iansutherland.ca >
2022-05-30 12:33:54 -04:00
Daeyeon Jeong
a07f5f28f3
http2: improve tests and docs
...
This commit documents the event parameters and `http2stream.respond`,
and adds some tests to ensure the actual behaviors are aligned with
the docs.
Testing the 'Http2Server.sessionError' event is added by updating
`test/parallel/test-http2-options-max-headers-exceeds-nghttp2.js`.
The event seemingly has not been tested so far.
`ServerHttp2Session` is exported to validate the `session` event
and the `sessionError` event.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/42858
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2022-05-30 12:33:54 -04:00
pupilTong
8f5b4570e5
net: add ability to reset a tcp socket
...
Fixes: https://github.com/nodejs/node/issues/27428
PR-URL: https://github.com/nodejs/node/pull/43112
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-05-30 12:33:54 -04:00
legendecas
41b69e3cf4
src,lib: migrate to console on context's extra binding
...
Since `globalThis.console` is not an ECMAScript defined
builtin, V8's globally installed `console` implementation
is been moved to the context's extra binding object.
We need to migrate to that one before the globally
installed console object is removed in V8.
PR-URL: https://github.com/nodejs/node/pull/43142
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-05-30 12:33:54 -04:00
Shogun
9539cfa358
http: add uniqueHeaders option to request and createServer
...
PR-URL: https://github.com/nodejs/node/pull/41397
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-05-30 12:33:54 -04:00
mawaregetsuka
701d40496d
lib: refactor validateInt32 and validateUint32
...
PR-URL: https://github.com/nodejs/node/pull/43071
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-05-30 12:33:54 -04:00
Kohei Ueno
c76caadf2e
debugger: throw a more useful error when the frame is missing
...
PR-URL: https://github.com/nodejs/node/pull/42776
Fixes: https://github.com/nodejs/node/issues/42775
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-05-30 12:33:54 -04:00