node/lib/internal/modules
Rafael Gonzaga 7f8d1b2681
permission: ignore internalModuleStat on module loading
This improves Permission Model usage when allowing read access to
specifi modules. To achieve that, the permission model check on
internalModuleStat has been removed meaning that on module loading,
uv_fs_stat is performed on files and folders even when the permission
model is enabled. Although a uv_fs_stat is performed, reading/executing
the module will still pass by the permission model check.

Without this PR when an app tries to --allow-fs-read=./a.js
--allow-fs-read=./b.js where `a` attempt to load b, it will fails as
it reads $pwd and no permission has been given to this path.

PR-URL: https://github.com/nodejs/node/pull/55797
Backport-PR-URL: https://github.com/nodejs/node/pull/58185
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
2025-08-14 12:39:42 +02:00
..
cjs permission: ignore internalModuleStat on module loading 2025-08-14 12:39:42 +02:00
esm typings: fix ImportModuleDynamicallyCallback return type 2025-06-11 09:21:23 +02:00
helpers.js module: implement the "module-sync" exports condition 2025-02-11 11:56:26 +01:00
package_json_reader.js module: move helpers out of cjs loader 2023-11-11 19:37:47 +01:00
run_main.js module: unflag detect-module 2025-02-11 11:56:12 +01:00