WInd3x, the iPod Bootrom exploit 10 years too late
A USB stack in the iPod BootROM uses a user-controlled index from the wIndex field of a SETUP packet to index an array of function pointers without bounds checking, allowing an attacker to execute arbitrary code. The author exploited this to achieve code execution on the iPod Nano 4G and 5G.
q3k.org
Published on q3k.org
The year is 2020. The End Times are nigh.
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
Impact
An attacker with physical USB access could achieve code execution on the iPod Nano 4G and 5G, bypassing the secure boot chain.
What the attacker needed
Physical USB access to the device; device in DFU mode
How it was found
- Send a crafted USB SETUP packet to the BootROM in DFU mode with bmRequestType set to 0x20 and wIndex set to 0xff00 to crash the BootROM.
- Set wIndex to 3 and send a Class request to treat a counter (ep0_txbuf_offs) as a code pointer.
- Schedule a firmware send from the device, then time out the read to set ep0_txbuf_offs to N-0x40.
- Send bmRequest=0x20 and wIndex=3 to execute at an address from 0x000 to 0x600.
- Use the 'blx r0' gadget at 0x3b0 to jump to the USB SETUP packet as ARM code.
- Craft a polyglot USB packet and ARM shellcode to achieve stable code execution.
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.
The iPod's early boot code includes a USB driver that handles setup packets. It takes a number from the packet and uses it to pick a function to call, but it never checks if the number is too large. By sending a specially crafted packet, an attacker can make the device call an arbitrary memory address and run their own code.
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.