deno icon indicating copy to clipboard operation
deno copied to clipboard

Panic: "Code generation from strings disallowed for this context" with 1.27.1

Open jfrancos opened this issue 2 years ago • 10 comments

Me and at least one other using Netlify edge functions are seeing

thread 'main' panicked at 'Failed to execute bootstrap script: EvalError: Code generation from strings disallowed for this context

I tried downgrading to 1.27.0 and the panic went away. More info here

jfrancos avatar Nov 04 '22 13:11 jfrancos

Caused by https://github.com/denoland/deno/commit/e18950284f279cfa8ec090cb8a882dbd64e92d4a. We need to not use dynamic code eval (instead isolate.execute_script, or generate the functions from JS rust side).

lucacasonato avatar Nov 04 '22 15:11 lucacasonato

I came here to close this ticket since Netlify has this addressed in this morning's release of [email protected] (and I can confirm it works).

But, it looks like Deno is also taking accountability for this so ... just want to connect you two @eduardoboucas @lucacasonato so you're not both fixing the same issue in different places.

jfrancos avatar Nov 04 '22 18:11 jfrancos

Yes, we're in touch. 🙂

But thanks for following up!

eduardoboucas avatar Nov 04 '22 23:11 eduardoboucas

Any updates on this?

I see that netlify solved this in https://github.com/netlify/edge-bundler/commit/d34499214be4311e28b9b2292b9ba714cd01c06b by removing --disallow-code-generation-from-strings.

But, I'd like to enable that flag for my use case to actually prevent code-generation when we are executing code (we are taking in user's code and would like to restrict what they can do).

vazexqi avatar Dec 09 '22 21:12 vazexqi

@littledivy please take a look

bartlomieju avatar Dec 09 '22 21:12 bartlomieju

@littledivy - Any updates on this? Trying to see if there's any chance this will be fixed in 1.29.

vazexqi avatar Dec 14 '22 19:12 vazexqi

@littledivy - Any updates on this? Trying to see if there's any chance this will be fixed in 1.29.

It will not be fixed in 1.29, maybe in one of the patch releases after 1.29.

bartlomieju avatar Dec 14 '22 21:12 bartlomieju

Sorry for the ping again, do we have an ETA on when this will be fixed? We are locked down to 1.27.0 until it's fixed.

vazexqi avatar Jan 27 '23 00:01 vazexqi

@littledivy is looking into this

bartlomieju avatar Jan 27 '23 15:01 bartlomieju

Any news on this? we'd also like to use --disallow-code-generation-from-strings, but are holding off due to the panic

mcodik avatar Feb 08 '23 16:02 mcodik