Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.4k
doc: clarify the scope of --disallow-code-generation-from-strings#58328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
ChALkeR left a comment • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
Documenting the incomplete behavior and setting it in stone would be more problematic, I think.
Instead, #28614 should have respected this flag
Not doing that that is hardly helpful and makes this flag close to useless.
While doing that will very unlikely break anything.
Also the path of least surprise in the behavior is blocking data imports on that flag, like browsers do with CSP.
See also explanation in #58221
legendecas commented May 14, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Node.js does not support CSP. This flag was originally exposed as a V8 flag, and documented in Node.js, only supporting guarding the listed APIs. #28614 did nothing wrong as the flag was never meant to interfere module system, including |
ChALkeR commented May 14, 2025
cc @nodejs/tsc pls discuss this |
aduh95 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a request for change so this doesn't land without @ChALkeR's objection getting dismissed by either Nikita or a TSC vote.
RaisinTen left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting here too:
Not something that needs to be done here. To stress that this is a V8 option, we can move it under https://nodejs.org/api/cli.html#useful-v8-options.
joyeecheung commented Jun 11, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I think we should make it clear that it is a V8 flag and can change or be removed at any time. Node.js does not provide stability guarantee of this and it should not be used for security purposes. It only provides whatever V8 provides - it's okay to document what they are now the last time people checked, but we should also note that the documentation on the Node.js side may not be up to date. If people are interested in a flag that does more than what the V8 flag does, IMO it's better to just implement a different flag that may or may not imply the V8 flag, depending on whether it's necessary/helpful. |
panva commented Jun 11, 2025
There's no need to list things it doesn't affect so long as there is a definitive list of what it does affect. To that end, being clear about the exact language features being disallowed is important, words such as "like" in the text should be removed and an exhaustive list of disallowed features needs to be present with no room for misinterpretation. Expanding the scope of the flag to disallow more non-v8 covered features is possible in a follow up contribution. |
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Fixes: #58221