3 ms·
executing code you didn't write is unsecure. news at 11. ...am i missing something? isn't this the same problem as with evaling json in javascript?
by baq 14y ago
executing code you didn't write is unsecure. news at 11.
...am i missing something? isn't this the same problem as with evaling json in javascript?
- praptak 14y agoNo, it would be somewhat analogous a json parser that doesn't only return a passive data struct but also executes arbitrary code.
- djpowell 14y agoLisps separate the notion of reading strings into data structures, from evaluating those data structures. So it would be easy to assume that read-string was safe to use, but there were actually some lesser-known features in the Clojure reader that allowed code execution.
- martinced 14y agoYou're missing that the whole point here is that when read-eval is set to false then, precisely, you're making your intent very clear: you do NOT want to execute code you didn't write. The problem is that there's a hole due to Java constructors being called (even when read-eval is set to false).