3 ms·
Focusing on the non-scifi angle here, there's one other reason besides C that we end up constantly running data when we think we're parsing it: the depth of our
by akkartik 4y ago
Focusing on the non-scifi angle here, there's one other reason besides C that we end up constantly running data when we think we're parsing it: the depth of our computational stack.
https://www.sitepoint.com/anatomy-of-an-exploit-an-in-depth-look-at-the-rails-yaml-vulnerability https://www.sitepoint.com/anatomy-of-an-exploit-an-in-depth-...
https://gitlab.com/gitlab-org/gitlab/-/issues/371098 https://gitlab.com/gitlab-org/gitlab/-/issues/371098
So I'd say we need 3 things:
* Stop using unsafe languages
* Use languages that separate parsing from execution. Just follow Lisp, have equivalents for `read` and `eval`. Lua is a notable offender here: https://www.lua.org/manual/5.4/manual.html#pdf-load https://www.lua.org/manual/5.4/manual.html#pdf-load There is no way to parse a table while guaranteeing no code execution.
* Use languages that forbid monkey-patching, because that's one vector for turning `read` into `eval` because someone had a bright idea.
- rmckayfleming 4y agoWith the caveat that you don't literally follow Lisp by having a #. reader macro.