Three RCE Vulnerabilities in VxWorks (covering 20 years of releases)
Three memory corruption flaws in VxWorks DHCP and DNS clients/servers allow remote attackers to overflow buffers and potentially execute code. The DHCP client heap overflow can be exploited by sending a malicious DHCP response with an oversized option length.
blog.exodusintel.com
Published on blog.exodusintel.com
AUGUST 9, 2016 Vulnerability Analysis, Exploit Techniques, News
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code trusts a length field from the network packet and copies that many bytes into a fixed-size buffer without checking the actual buffer size.
What the attacker needed
Attacker on same network or spoofing; for DHCP client: guess 2-byte transaction ID; for DNS: control name server or MITM
How it was found
- Send a DHCP response with an option code 1, 16, 28, 32, or 54 whose length is greater than 4.
- The client allocates a 4-byte buffer and copies the option data using the packet's length, overflowing the heap.
- Arrange heap layout with small options to place a free chunk after the buffer.
- Overflow into the free chunk's metadata to corrupt its pointers.
- Allocate the corrupted chunk to overwrite a function pointer for option 48.
- Trigger the overwritten function pointer by including option 48 in the packet.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
These bugs are like a delivery service that accepts a package bigger than your mailbox: the software copies more data than the space it reserved, so extra data spills into nearby memory. An attacker on the same network can send crafted network messages to trigger the spill and possibly run their own code on the device.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.