Analysis of the jailbreakme v3 font exploit
A missing bounds check on the argument count for the callothersubr operation in FreeType's Type 1 font interpreter allowed a malicious font to move the stack pointer outside its bounds, giving read and write access to the decoder structure. The exploit used this to build a ROP payload, bypass ASLR, and execute a kernel exploit to jailbreak iOS devices.
esec-lab.sogeti.com
Published on esec-lab.sogeti.com
The vulnerability (CVE-2011-0226) is located in the interpreter for Type 1 font programs. Vector font formats like Adobe Type 1 use small interpreted programs to render characters outlines at different sizes.
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
What the attacker needed
Victim opens a malicious PDF; iOS device with vulnerable FreeType; specific iOS version and device model
How it was found
- Extract the font from the jailbreakme PDF file using Origami.
- Disassemble the charstrings in the font to understand the Type 1 opcodes.
- Use callothersubr #42 with a negative argument count to move the stack pointer beyond the stack area.
- Leak the parse_callback field and other values, then construct a ROP payload in the buildchar array.
- Overwrite parse_callback with a gadget address and trigger a call to it via the op_seac instruction.
- The ROP payload exploits a kernel vulnerability to run a binary that installs the jailbreak.
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.
Fonts can contain small programs that tell the computer how to draw letters. A bug in the software that runs these programs let a malicious font trick the program into reading and writing memory it should not touch. The attacker used this to run their own code and take control of 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.