Diving Deeper into WatchGuard Pre-Auth RCE [CVE-2022-26318]

We discussed this vulnerability during Episode 138 on 19 April 2022

strcat was used in a callback to craft the xpath for each element and it did this without any bounds checking. By nesting XML structures they could eventually overflow the memory region they were allocated in. As this region immediately preceded heap memory it was possible to overflow into the heap and overwrite the xml parser’s callback function pointers (approximately 11,000 bytes away) and kick off a ROP chain.