isolated-vm
isolated-vm copied to clipboard
Disable completely code generation from strings?
Thanks for creating this amazing library. I wonder how we can disable completely code generation from strings?
It's disabled by default here: https://github.com/laverdet/isolated-vm/blob/19b3624b962c13526f78949fd8a6391895a9463d/src/isolate/environment.cc#L482
But then is allowed in the CodeGenCallback
:
https://github.com/laverdet/isolated-vm/blob/19b3624b962c13526f78949fd8a6391895a9463d/src/isolate/environment.cc#L128
I don't really understand why the above is set to true
, which allows executing code within eval()
, new Function()
, ... Shouldn't it be set to false
instead? Initially found in https://github.com/lagonapp/lagon/pull/84
We use the callback and the flag as a means to prevent OOM memory crashes, rather than as a hardening feature.