Blasting Past WebP - An analysis of the NSO BLASTPASS iMessage exploit
A zero-click iMessage exploit chain used a malformed PassKit attachment containing a lossless WebP image to trigger a heap buffer overflow in the WebP Huffman table decoder, then relied on a large binary plist heap groom and an NSExpression payload to gain code execution inside the BlastDoor sandbox. The attacker could compromise a victim's iPhone running the latest iOS without any interaction.
googleprojectzero.blogspot.com
Published on googleprojectzero.blogspot.com
On September 7, 2023 Apple issued an out-of-band security update for iOS:
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 the WebP decoder validated Huffman trees only after building the decoding table, while the pre-computed table size was only correct for valid trees, so a malformed tree caused an out-of-bounds write.
Impact
The exploit could compromise iPhones running the latest iOS without victim interaction, though the author notes the iOS version range where the heap grooming works appears to be small and his own attempts only reached a heap metadata integrity check failure.
What the attacker needed
Victim uses iMessage; attacker sends a crafted PKPass; no user interaction required; specific iOS version for grooming
How it was found
- Send a PassKit attachment containing a WebP image with a crafted lossless VP8L chunk to the victim over iMessage.
- The WebP parser builds Huffman decoding tables from attacker-controlled code lengths, overflowing a pre-allocated buffer.
- A large binary plist in the EXIF MakerNote tag grooms the heap so the overflow lands on a chosen object.
- The overflow writes a fixed value past the end of the table allocation, corrupting the groomed structure.
- An NSExpression payload embedded in the groom is later evaluated, giving code execution inside BlastDoor.
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 phone receives a message with an attachment that looks like a wallet pass. Inside it is an image file that the phone's image decoder mishandles, writing a small amount of data past the end of a buffer it allocated. The attacker carefully arranged memory beforehand so that this small overflow lands on something useful, letting them run their own code on the phone without the user tapping anything.
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.