Skip to content
Memory corruption Write-up Advanced

A look at an Android ITW DNG exploit

A malicious DNG image abused out-of-bounds plane parameters in the Samsung Quram DNG decoder's DeltaPerColumn opcode handler, letting an attacker add chosen values at chosen offsets relative to a heap pixel buffer. This gave a strong memory-corruption primitive that the exploit chain used to execute code in the com.samsung.ipservice process.

googleprojectzero.blogspot.com

Published on googleprojectzero.blogspot.com

Between July 2024 and February 2025, 6 suspicious image files were uploaded to VirusTotal. Thanks to a lead from Meta, these samples came to the attention of Google Threat Intelligence Group.

The author, on googleprojectzero.blogspot.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 the DeltaPerColumn handler computed the last plane as image plane count plus opcode plane count instead of first plane plus count, and never validated that the resulting plane range stayed within the image's planes.

Impact

An attacker could corrupt heap memory with chosen values at chosen offsets, which the exploit chain used to run code in a privileged Samsung system process; the text notes delivery may require the victim to click the image unless a download bypass exists.

What the attacker needed

Image delivered to the device; image added to MediaStore; victim may need to click the image; Samsung device with Quram library

The fix

The plane range should be validated against the image's plane count and the last-plane calculation corrected; the text says the Samsung vulnerability was fixed in April 2025.

How it was found

  1. Deliver a file with a jpeg extension that is actually a DNG image to the target device.
  2. Have the image land in the MediaStore so the Samsung ipservice process parses it.
  3. The decoder falls back to the DNG path and parses the opcode lists.
  4. A TrimBounds opcode shapes the heap before the bug is triggered.
  5. A DeltaPerColumn opcode with out-of-range plane values causes a single controlled write past the pixel buffer.

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 DNG is a camera raw image format, and it can carry small processing instructions called opcodes that the image library runs while decoding. Here the library trusted numbers in those instructions that said which colour channel to edit, and it never checked they were inside the image, so it wrote outside the pixel buffer. Because the attacker also controls the value written, this becomes a way to corrupt memory and eventually run 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.

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.