Skip to content
Memory corruption Write-up Advanced

Exploiting the iPhone 4

The author documents building a jailbreak for the iPhone 4 by exploiting the limera1n boot ROM vulnerability, which allows arbitrary code execution on a DFU-mode device over USB. The write-up focuses on the tooling and payload development rather than a novel vulnerability, and notes that the exact mechanism of limera1n is not publicly understood.

axleos.com

Published on axleos.com

This series follows along as I build gala, an iOS 4 jailbreak for the iPhone 4.

The author, on axleos.com

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

Likely a race condition in the SecureROM's handling of USB control messages during DFU mode, leading to a heap overflow that allows shellcode injection.

What the attacker needed

Physical USB access to the device; device in DFU mode; vulnerable A4 chip

The fix

The flaw cannot be patched in existing devices because the SecureROM is read-only; Apple would need to fix it in new hardware revisions.

How it was found

  1. Put the iPhone 4 into DFU mode and connect it to a host over USB.
  2. Send an iBSS image to the device using USB control packets.
  3. Trigger the limera1n exploit to gain code execution.
  4. Run a payload that copies SecureROM memory to the USB receive area.
  5. Read the copied memory from the host using USB read requests.

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.

A boot ROM is the very first code a phone runs when it powers on, and it is burned into the chip so it cannot be updated. If that code has a bug, someone can take over the device early in startup and run their own code. This article describes using such a bug to run custom code on an old iPhone.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.