4 ms·
They're all classes of the same problem: hard to check for resource consumption from apparently innocent input. #define s, any kind of macro system they all su
by tisme 14y ago
They're all classes of the same problem: hard to check for resource consumption from apparently innocent input.
#define s, any kind of macro system they all suffer from this, as soon as you are allowed to define an entity referencing another defined entity you have a bomb on board.
- chubot 14y agoIt's not really the same. If bash had a separate parse step (which isn't too hard to imagine), you could parse a fork bomb without any trouble. Executing it is what's dangerous. A better analogy would be a language where you can't even parse it without executing arbitrary code (Perl is probably a good example: http://www.perlmonks.org/?node_id=663393 http://www.perlmonks.org/?node_id=663393) Python AFAICT is quite safe to parse. It's not a common distinction because you normally parse stuff to execute it, and executing can do much worse things, of course. But where it might come into play is if you wanted to write a cloud service accepts arbitrary code and just does static analysis on python or bash. What kind of security would you need? It's a design flaw in the format itself -- in this case, XML. A fork bomb is not a flaw in the design of bash.
- oakwhiz 14y agoI suppose that how safe a grammar is to parse depends on whether or not there are language constructs that can generate exponential growths of memory usage, how much memory you have available for the task, and whether or not it can even be parsed at all. It seems like the only way to totally secure an automated system against this kind of attack is to have a limit on parser memory usage and CPU cycles, and reject input when the parser breaks any of these limits.