r/ExploitDev • u/Fun_Lawfulness_8167 • 16h ago
PE Parsing: Reverse Engineering Tools Kryptonite (Can You Break Mine?)
https://github.com/Ryftenius/RESXDoing open-source security research has taught me a lot about the common misconceptions in security tooling, especially RE tooling, around how Windows loads the PE and builds the PEB.
Take Ghidra, for example. I found a Denial of Service vulnerability caused by a parser misconception and unchecked recursion: a cyclic x64 chained unwind structure causes a StackOverflowError during PE import, while the same file loads and runs perfectly fine on Windows.
https://github.com/NationalSecurityAgency/ghidra/security/advisories/GHSA-vxmq-6v38-hgf6
Or x64dbg, where I found multiple ways to crash it on attach because of assumptions it makes about the target's PEB format.
When I was learning secure-software development, one of the main things I learnt was to never, ever, trust attacker-controlled input. In any RE tool, the file you're importing or analyzing is attacker-controlled input. The entire PE has to be validated, including anything that could be corrupted (section lengths, sections in general, unwind directories, file names). Treat everything as dangerous input until it's sanitized.
So here's my challenge to reverse-engineers, security researchers and exploit devs: break RESX while it parses your file.
RESX is a tool I'm actively developing to make malware analysis on Windows easier. Part of that is, of course, not crashing on file import, or handing you an RCE. I want your feedback, and I want your worst files, and security advisories!
2
u/SuperMid 15h ago •
Just wanted to say that I'm impressed by your work, although most of it is still spanish for me while I learn proper AppSec/Security hardening concepts. Thanks, and will stay tuned.