RafaelGSS
389f239a28
src,loader,permission: throw on InternalWorker use
...
Previously this PR it was expected that InternalWorker
usage doesn't require the --allow-worker when the permission
model is enabled. This, however, exposes a vulnerability
whenever the instance gets accessed by the user. For example
through diagnostics_channel.subscribe('worker_threads')
PR-URL: https://github.com/nodejs-private/node-private/pull/652
Refs: https://hackerone.com/reports/2575105
CVE-ID: CVE-2025-23083
2025-01-19 20:43:29 -03:00
Antoine du Hamel
6027084245
test: make test-loaders-workers-spawned less flaky
...
PR-URL: https://github.com/nodejs/node/pull/55172
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2024-11-17 11:51:47 +01:00
Antoine du Hamel
7c88739b83
test: fix some tests when path contains %
...
Tests should pass even if the path where the repo is cloned contains
URL-significant chars.
PR-URL: https://github.com/nodejs/node/pull/55082
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2024-11-17 11:51:38 +01:00
Antoine du Hamel
0dd4639391
esm: fix support for URL instances in import.meta.resolve
...
PR-URL: https://github.com/nodejs/node/pull/54690
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-10-02 16:04:14 +02:00
Giovanni Bucci and Jacob Smith
3606c53fdc
test: refactor test-esm-type-field-errors
...
Co-Authored-By: Jacob Smith <jacob@frende.me >
PR-URL: https://github.com/nodejs/node/pull/54368
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-10-02 07:57:53 +02:00
Geoffrey Booth
90b632ee02
module: warn on detection in typeless package
...
PR-URL: https://github.com/nodejs/node/pull/52168
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-09-21 12:06:21 +02:00
Vinicius Lourenço
c667fbd988
lib: improve error message when index not found on cjs
...
PR-URL: https://github.com/nodejs/node/pull/53859
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-08-19 10:32:42 +02:00
Geoffrey Booth and Gabriel Bota
5d03f6fab7
esm: move hooks test with others
...
Co-authored-by: Gabriel Bota <gabriel.bota@dynatrace.com >
PR-URL: https://github.com/nodejs/node/pull/53558
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-08-19 10:32:23 +02:00
Joyee Cheung
7625dc4927
module: fix submodules loaded by require() and import()
...
Previously there is an edge case where submodules loaded by require()
may not be loaded by import() again from different intermediate
edges in the graph. This patch fixes that, added tests, and added
debug logs.
Drive-by: make loader a private field so it doesn't show up in logs.
PR-URL: https://github.com/nodejs/node/pull/52487
Backport-PR-URL: https://github.com/nodejs/node/pull/53500
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2024-08-08 15:03:05 +02:00
Joyee Cheung
51b88faeac
module: disallow CJS <-> ESM edges in a cycle from require(esm)
...
This patch disallows CJS <-> ESM edges when they come from
require(esm) requested in ESM evalaution.
Drive-by: don't reuse the cache for imported CJS modules to stash
source code of required ESM because the former is also used for
cycle detection.
PR-URL: https://github.com/nodejs/node/pull/52264
Backport-PR-URL: https://github.com/nodejs/node/pull/53500
Fixes: https://github.com/nodejs/node/issues/52145
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-08-08 15:02:56 +02:00
Joyee Cheung
cad46afc07
module: support require()ing synchronous ESM graphs
...
This patch adds `require()` support for synchronous ESM graphs under
the flag `--experimental-require-module`
This is based on the the following design aspect of ESM:
- The resolution can be synchronous (up to the host)
- The evaluation of a synchronous graph (without top-level await) is
also synchronous, and, by the time the module graph is instantiated
(before evaluation starts), this is is already known.
If `--experimental-require-module` is enabled, and the ECMAScript
module being loaded by `require()` meets the following requirements:
- Explicitly marked as an ES module with a `"type": "module"` field in
the closest package.json or a `.mjs` extension.
- Fully synchronous (contains no top-level `await`).
`require()` will load the requested module as an ES Module, and return
the module name space object. In this case it is similar to dynamic
`import()` but is run synchronously and returns the name space object
directly.
```mjs
// point.mjs
export function distance(a, b) {
return (b.x - a.x) ** 2 + (b.y - a.y) ** 2;
}
class Point {
constructor(x, y) { this.x = x; this.y = y; }
}
export default Point;
```
```cjs
const required = require('./point.mjs');
// [Module: null prototype] {
// default: [class Point],
// distance: [Function: distance]
// }
console.log(required);
(async () => {
const imported = await import('./point.mjs');
console.log(imported === required); // true
})();
```
If the module being `require()`'d contains top-level `await`, or the
module graph it `import`s contains top-level `await`,
[`ERR_REQUIRE_ASYNC_MODULE`][] will be thrown. In this case, users
should load the asynchronous module using `import()`.
If `--experimental-print-required-tla` is enabled, instead of throwing
`ERR_REQUIRE_ASYNC_MODULE` before evaluation, Node.js will evaluate the
module, try to locate the top-level awaits, and print their location to
help users fix them.
PR-URL: https://github.com/nodejs/node/pull/51977
Backport-PR-URL: https://github.com/nodejs/node/pull/53500
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2024-08-08 15:02:48 +02:00
Antoine du Hamel and Michaël Zasso
8653d9223e
test: replace .substr with .slice
...
`String.prototype.substr` is deprecated, and using it will raise an
error when using ESLint 9+.
Co-authored-by: =?UTF-8?q?Micha=C3=ABl=20Zasso?= <targos@protonmail.com >
PR-URL: https://github.com/nodejs/node/pull/53070
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Tierney Cyren <hello@bnb.im >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2024-07-19 15:26:51 +02:00
RafaelGSS
60e184a6e4
lib,esm: handle bypass network-import via data:
...
PR-URL: https://github.com/nodejs-private/node-private/pull/522
CVE-ID: CVE-2024-22020
2024-07-03 16:59:30 -03:00
Geoffrey Booth
882a64e639
module: fix detect-module not retrying as esm for cjs-only errors
...
PR-URL: https://github.com/nodejs/node/pull/52024
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-05-03 08:29:12 +02:00
Joyee Cheung
d30cccdf8c
v8: implement v8.queryObjects() for memory leak regression testing
...
This is similar to the `queryObjects()` console API provided by the
Chromium DevTools console. It can be used to search for objects that
have the matching constructor on its prototype chain in the entire
heap, which can be useful for memory leak regression tests. To avoid
surprising results, users should avoid using this API on constructors
whose implementation they don't control, or on constructors that can
be invoked by other parties in the application.
To avoid accidental leaks, this API does not return raw references to
the objects found. By default, it returns the count of the objects
found. If `options.format` is `'summary'`, it returns an array
containing brief string representations for each object. The visibility
provided in this API is similar to what the heap snapshot provides,
while users can save the cost of serialization and parsing and directly
filer the target objects during the search.
We have been using this API internally for the test suite, which
has been more stable than any other leak regression testing
strategies in the CI. With a public implementation we can now
use the public API instead.
PR-URL: https://github.com/nodejs/node/pull/51927
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2024-05-02 10:57:59 +02:00
unbyte
861e040b40
lib,src: extract sourceMappingURL from module
...
PR-URL: https://github.com/nodejs/node/pull/51690
Refs: https://github.com/nodejs/node/issues/51522
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2024-03-25 19:27:39 +00:00
Joyee Cheung
0211a3d65f
vm: support using the default loader to handle dynamic import()
...
This patch adds support for using
`vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER` as
`importModuleDynamically` in all APIs that take the option
except `vm.SourceTextModule`. This allows users to have a shortcut
to support dynamic import() in the compiled code without missing
the compilation cache if they don't need customization of the
loading process. We emit an experimental warning when the
`import()` is actually handled by the default loader through
this option instead of requiring `--experimental-vm-modules`.
In addition this refactors the documentation for
`importModuleDynamically` and adds a dedicated section for it
with examples.
`vm.SourceTextModule` is not supported in this patch because
it needs additional refactoring to handle `initializeImportMeta`,
which can be done in a follow-up.
PR-URL: https://github.com/nodejs/node/pull/51244
Fixes: https://github.com/nodejs/node/issues/51154
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2024-03-25 19:26:26 +00:00
Antoine du Hamel
a6b3569121
esm: improve error when calling import.meta.resolve from data: URL
...
PR-URL: https://github.com/nodejs/node/pull/49516
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-03-25 19:25:39 +00:00
Joyee Cheung
1d8e65a230
test: use checkIfCollectableByCounting in SourceTextModule leak test
...
...which may be more reliable than than checkIfCollectable().
PR-URL: https://github.com/nodejs/node/pull/51512
Refs: https://github.com/nodejs/node/pull/51362
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2024-03-25 19:24:56 +00:00
per4uk
43a8d3e984
module: fix --preserve-symlinks-main
...
Fixes resolving main module when the `argv[1]` was pointing to a symlink
without its file extension.
PR-URL: https://github.com/nodejs/node/pull/51312
Fixes: https://github.com/nodejs/node/issues/41000
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-03-25 19:24:09 +00:00
Antoine du Hamel
38f4000905
esm: fix hint on invalid module specifier
...
PR-URL: https://github.com/nodejs/node/pull/51223
Fixes: https://github.com/nodejs/node/issues/51216
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-03-25 18:15:05 +00:00
Luigi Pinca
996cef51b7
test: use tmpdir.refresh() in test-esm-loader-resolve-type.mjs
...
Use `tmpdir.refresh()` in
`test/es-module/test-esm-loader-resolve-type.mjs` so that the temporary
directory is removed when the test exits.
PR-URL: https://github.com/nodejs/node/pull/51206
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
2024-03-25 18:14:04 +00:00
Luigi Pinca
8f2d982342
test: use tmpdir.refresh() in test-esm-json.mjs
...
Use `tmpdir.refresh()` in `test/es-module/test-esm-json.mjs` so that
the temporary directory is removed when the test exits.
PR-URL: https://github.com/nodejs/node/pull/51205
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
2024-03-25 18:14:02 +00:00
Hiroki Osame
5fc10ca4d6
module: load source maps in commonjs translator
...
PR-URL: https://github.com/nodejs/node/pull/51033
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-03-25 17:28:41 +00:00
Bruce MacNaughton
e39e37bbd5
esm: fix hook name in error message
...
PR-URL: https://github.com/nodejs/node/pull/50466
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-03-25 17:27:57 +00:00
Yagiz Nizipli
362135a1f9
src: disable uncaught exception abortion for ESM syntax detection
...
PR-URL: https://github.com/nodejs/node/pull/50987
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2024-03-25 17:27:28 +00:00
Michaël Zasso
b2b4132c3e
src: iterate on import attributes array correctly
...
The array's length is supposed to be a multiple of two for dynamic
import callbacks.
Fixes: https://github.com/nodejs/node/issues/50700
PR-URL: https://github.com/nodejs/node/pull/50703
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-01-09 08:23:01 +00:00
Antoine du Hamel
843d5f84ca
esm: fallback to getSource when load returns nullish source
...
When using the Modules Customization Hooks API to load CommonJS modules,
we want to support the returned value of `defaultLoad` which must be
nullish to preserve backward compatibility. This can be achieved by
fetching the source from the translator.
PR-URL: https://github.com/nodejs/node/pull/50825
Fixes: https://github.com/nodejs/node/issues/50435
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2023-12-19 16:17:57 +00:00
Francesco Trotta
8d5469c84b
esm: do not call getSource when format is commonjs
...
Ensure that `defaultLoad` does not uselessly access the file system to
get the source of modules that are known to be in CommonJS format.
This allows CommonJS imports to resolve in the current phase of the
event loop.
Refs: https://github.com/eslint/eslint/pull/17683
PR-URL: https://github.com/nodejs/node/pull/50465
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-12-19 16:17:57 +00:00
Antoine du Hamel
b48cf314d3
esm: bypass CJS loader in default load under --default-type=module
...
This allows user to opt-out from using the monkey-patchable CJS loader,
even to load CJS modules.
PR-URL: https://github.com/nodejs/node/pull/50004
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-12-11 17:50:18 +00:00
Antoine du Hamel
77e8361213
module: execute --import sequentially
...
PR-URL: https://github.com/nodejs/node/pull/50474
Fixes: https://github.com/nodejs/node/issues/50427
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-12-11 11:12:15 +00:00
Chengzhong Wu
2664012617
vm: allow dynamic import with a referrer realm
...
A referrer can be a Script Record, a Cyclic Module Record, or a Realm
Record as defined in https://tc39.es/ecma262/#sec-HostLoadImportedModule .
Add support for dynamic import calls with a realm as the referrer and
allow specifying an `importModuleDynamically` callback in
`vm.createContext`.
PR-URL: https://github.com/nodejs/node/pull/50360
Refs: https://github.com/nodejs/node/issues/49726
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-12-11 11:12:15 +00:00
James Sumners
c1a196c897
esm: add import.meta.dirname and import.meta.filename
...
PR-URL: https://github.com/nodejs/node/pull/48740
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-12-11 11:12:14 +00:00
Marco Ippolito
fffc4951ac
module: add application/json in accept header when fetching json module
...
PR-URL: https://github.com/nodejs/node/pull/50119
Refs: https://github.com/nodejs/node/issues/50116
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-12-11 11:12:12 +00:00
Antoine du Hamel
6c59114947
test: ensure never settling promises are detected
...
PR-URL: https://github.com/nodejs/node/pull/50318
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-12-11 11:11:46 +00:00
Antoine du Hamel
3b867e4256
esm: do not give wrong hints when detecting file format
...
PR-URL: https://github.com/nodejs/node/pull/50314
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-11-11 20:34:41 +01:00
Antoine du Hamel
3d9130bc2e
Revert "test: set test-esm-loader-resolve-type as flaky"
...
This reverts commit 2e4bb3c017 .
PR-URL: https://github.com/nodejs/node/pull/50315
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
2023-11-11 20:33:22 +01:00
Geoffrey Booth
a589a1a905
esm: detect ESM syntax in ambiguous JavaScript
...
PR-URL: https://github.com/nodejs/node/pull/50096
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
2023-11-11 20:32:11 +01:00
Antoine du Hamel
5c56081d67
test: deflake test-loaders-workers-spawned
...
PR-URL: https://github.com/nodejs/node/pull/50251
Fixes: https://github.com/nodejs/node/issues/50247
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-11-11 20:30:57 +01:00
Yagiz Nizipli
696ba93329
test: set test-esm-loader-resolve-type as flaky
...
Ref: https://github.com/nodejs/node/issues/50040
PR-URL: https://github.com/nodejs/node/pull/50226
Refs: https://github.com/nodejs/node/issues/50040
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-11-11 20:29:47 +01:00
Antoine du Hamel
ee65e44c31
esm: use import attributes instead of import assertions
...
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,
This commit updates the documentation to encourage folks to use the new
syntax, and add aliases for module customization hooks.
PR-URL: https://github.com/nodejs/node/pull/50140
Fixes: https://github.com/nodejs/node/issues/50134
Refs: https://github.com/v8/v8/commit/159c82c5e6392e78b9bba7161b1bed6e23758984
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-11-11 20:22:36 +01:00
Jithil P Ponnan
d9c791a508
lib: fix compileFunction throws range error for negative numbers
...
PR-URL: https://github.com/nodejs/node/pull/49855
Fixes: https://github.com/nodejs/node/issues/49848
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-11-11 19:56:03 +01:00
Geoffrey Booth
4de838fdeb
esm: bypass CommonJS loader under --default-type
...
PR-URL: https://github.com/nodejs/node/pull/49986
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-11-11 19:55:23 +01:00
Node.js GitHub Bot
1cc6cbff26
tools: update eslint to 8.50.0
...
PR-URL: https://github.com/nodejs/node/pull/49989
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-11-11 19:40:05 +01:00
Geoffrey Booth
27e02b633d
esm: unflag extensionless javascript and wasm in module scope
...
PR-URL: https://github.com/nodejs/node/pull/49974
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2023-11-11 19:39:38 +01:00
Richard Lau
01b01527d7
test: update skip for moved test-wasm-web-api
...
`test-wasm-web-api` was moved from `test/parallel` to `test/es-modules`.
Update the status files for parallel and es-modules accordingly.
Refs: https://github.com/nodejs/node/pull/49869
Refs: https://github.com/nodejs/node/pull/47299
Refs: https://github.com/nodejs/node/issues/47297
PR-URL: https://github.com/nodejs/node/pull/49958
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-11-11 19:38:36 +01:00
Antoine du Hamel
c48cd84188
esm: fix cache collision on JSON files using file: URL
...
PR-URL: https://github.com/nodejs/node/pull/49887
Fixes: https://github.com/nodejs/node/issues/49724
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2023-11-11 19:34:47 +01:00
Geoffrey Booth
dc80ccef25
esm: --experimental-default-type flag to flip module defaults
...
PR-URL: https://github.com/nodejs/node/pull/49869
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-11-11 19:34:42 +01:00
Tobias Nießen
f5c90b2951
module: fix code injection through export names
...
createDynamicModule() properly escapes import names, but not export
names. In WebAssembly, any string is a valid export name. Importing a
WebAssembly module that uses a non-identifier export name leads to
either a syntax error in createDynamicModule() or to code injection,
that is, to the evaluation of almost arbitrary JavaScript code outside
of the WebAssembly module.
To address this issue, adopt the same mechanism in createExport() that
createImport() already uses. Add tests for both exports and imports.
PR-URL: https://github.com/nodejs-private/node-private/pull/461
Backport-PR-URL: https://github.com/nodejs-private/node-private/pull/489
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
CVE-ID: CVE-2023-39333
2023-10-12 10:11:46 -03:00
Joyee Cheung
be211ef818
test: deflake test-vm-contextified-script-leak
...
Similar to the test-vm-source-text-module-leak fix, use a snapshot
to force a thorough GC in order to prevent false positives.
Backport-PR-URL: https://github.com/nodejs/node/pull/49874
PR-URL: https://github.com/nodejs/node/pull/49710
Refs: https://github.com/nodejs/reliability/issues/669
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2023-09-28 15:28:24 -04:00