You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--disallow-code-generation-from-strings is ignored since versions 16.17 and 18.6 #44287
$ node --disallow-code-generation-from-stringsWelcome to Node.js v16.16.0.Type ".help" for more information.
> eval("1+2")Uncaught EvalError: Code generation from strings disallowed for this context
What do you see instead?
$ node --disallow-code-generation-from-strings 09:34Welcome to Node.js v18.7.0.Type ".help" for more information.
> eval("1+2")3
Additional information
Has the flag been deprecated? Is there a new flag we can use? I couldn't find any documentation about this change.
It works correctly in versions 16.16 and 18.5, but seems ignored in versions 16.17, 18.6, and 18.7.
changed the title [-]Regression: --disallow-code-generation-from-strings is ignored since version 16.17 and 18.6[/-][+]Regression: --disallow-code-generation-from-strings is ignored since versions 16.17 and 18.6[/+]on Aug 19, 2022
changed the title [-]Regression: --disallow-code-generation-from-strings is ignored since versions 16.17 and 18.6[/-][+]--disallow-code-generation-from-strings is ignored since versions 16.17 and 18.6[/+]on Aug 19, 2022
Activity
[-]Regression: --disallow-code-generation-from-strings is ignored since version 16.17 and 18.6[/-][+]Regression: --disallow-code-generation-from-strings is ignored since versions 16.17 and 18.6[/+][-]Regression: --disallow-code-generation-from-strings is ignored since versions 16.17 and 18.6[/-][+]--disallow-code-generation-from-strings is ignored since versions 16.17 and 18.6[/+]targos commentedon Aug 19, 2022
I suspect 02eb10b
/cc @legendecas
legendecas commentedon Aug 19, 2022
Looks like we'll need to restore the default value set in v8: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/init/bootstrapper.cc;l=6511?q=FLAG_disallow_code_generation_from_strings. I'll submit a fix for this. Thank you for reporting this.
src: restore context default IsCodeGenerationFromStringsAllowed value
src: restore context default IsCodeGenerationFromStringsAllowed value