4 ms·
So, how much memory would a real-world parser actually consume given this file? I'd try it, but I had to RMA my workstation's motherboard yesterday, leaving me
by wtallis 14y ago
So, how much memory would a real-world parser actually consume given this file? I'd try it, but I had to RMA my workstation's motherboard yesterday, leaving me with a machine that only has 3GB, which is the obvious minimum for a full expansion. But I could imagine an XML parser might use UCS-2 internally, inflating this to 6GB. Or, some parsers might be clever and not attempt a full expansion.
- ghshephard 14y agoYou could try using an iteration that only required 300 MB for a full expansion...
- zurn 14y agoSo you're asking how much memory this resoource exhaustion attack consumes when you run it. Each line in the WP examaple amplifies by a factor of 10. It has 9 lines. It's 10e9. That's a billion times 3, which is just enough to 32-bit virtual memory space in common operating systems. Of course the XML implementation could be smart and short-circuit this while preserving the semantics.
- dbaupp 14y agoI think you mean 10^9 = 1e9 rather than 10e9. (And the parent actually mentioned the 3 GB minimum, I think it was essentially asking how much extra memory a real world XML parser uses.)
- irishcoffee 14y agoNope, 10e8 is what you're both looking for, as 1^9 is.. 1.