Webkit webassembly parsing does not correctly check section order Vulnerability / Exploit
/
/
/
Exploits / Vulnerability Discovered : 2018-04-09 |
Type : dos |
Platform : multiple
This exploit / vulnerability Webkit webassembly parsing does not correctly check section order is for educational purposes only and if it is used you will do on your own risk!
[+] Code ...
When a WebAssembly binary is parsed in ModuleParser::parse, it is expected to contain certain sections in a certain order, but can also contain custom sections that can appear anywhere in the binary. The ordering check validateOrder() does not adequately check that sections are in the correct order when a binary contains custom sections.
If the previous section was a custom section, the check always returns true, even if the section is otherwise out of order. This means any number of sections can be parsed from a binary, any number of times in any order. This leads to a number of possible overflows and type confusion bugs, as parsing assumes most sections are unique and in the right order.
The attached html file causes a crash in Safari, the wasm file is attached as well. This particular use of the bug causes an overflow in the function vector.
Proof of Concept:
https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/44427.zip
Webkit webassembly parsing does not correctly check section order