[v20.x] 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 [email protected] Reviewed-By: Ulises Gascón [email protected]
Review requested:
- [ ] @nodejs/loaders
- [ ] @nodejs/security-wg
Failed to start CI
⚠ Commits were pushed since the last approving review: ⚠ - permission: ignore internalModuleStat on module loading ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/16306740577
CI: https://ci.nodejs.org/job/node-test-pull-request/68083/
CI: https://ci.nodejs.org/job/node-test-pull-request/68173/
Landed in 7f8d1b2681a8