3 ms·
Would a primitive recursive language be less dangerous? Well, it depends on the language. > They are dangerous to parse not because they can potentially run fo
by taejo 11y ago
Would a primitive recursive language be less dangerous? Well, it depends on the language.
> They are dangerous to parse not because they can potentially run forever, but because due to their expressiveness, it is very easy to arbitraily trigger bugs, aided by the massive nessisary complexity of most parsers.
> Those two things together make avoiding logic errors invoked by malicious data, leading to exploitability essentially impossible to prevent.
Actually, the parsers for these languages are not too complex -- the problem is that they're written in a language ill-suited to writing parsers. The interpreters are complex, but all the exploitability is very easily avoided: by writing the interpreter in a memory-safe language.
This problem might be bug-prone, but a bug in a font interpreter should lead to whacky looking fonts, and never to remote code execution. The fact that it routinely does just shows we're using the wrong tools for the job.
- throwaway2048 11y agothere are more classes of exploits than simply memory management errors. For instance look at the laundry list of issues surrounding verification of x.509 certificates. Deciding a forged certificate is valid is catastrophic, and invokes no sort of memory related exploit at all.
- taejo 11y agoX.509 certificates don't contain any Turing-complete languages, so the fact that X.509 interpreters have the same class of bugs as font interpreters, that supports my point that Turing-completeness itself is not the problem.