Closed
Description
System information
tfjs-tflite 0.0.1-alpha.9
Describe the current behavior
When setting CSP policy, we get "Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script". We traced this to createNamedFunction()
which seems to come from emscripten and uses new Function()
. Seemingly it can be disabled at compilation.
Reference:
https://stackoverflow.com/a/64814360
https://github.com/emscripten-core/emscripten/blob/1bc49003b9a5310362d2e4a6334a62be9cd56dc2/src/settings.js#L1282
Describe the expected behavior
Don't use evil eval() :)