Samsung image parser allows out-of-bounds write leading to remote code execution via WhatsApp DNG images
A flaw in the Quram DNG decoder on Samsung devices enables arbitrary memory writes and full remote code execution when a crafted DNG image is opened through WhatsApp.
Security & privacy Google Project Zero 12 Dec 2025 Attack Real-world evidence
Published as “A look at an Android ITW DNG exploit”
Why it matters
A single image file can give an attacker full code execution on Samsung Android devices, exposing all media and enabling spyware deployment.
Summary
The researchers reverse-engineered the proprietary Quram library used by Samsung's com.samsung.ipservice service and discovered an out-of-bounds write in the DeltaPerColumn opcode handler. By crafting a DNG file with malicious opcode parameters, they corrupt a pixel buffer pointer and build a JOP chain that ultimately calls system() with a shell payload. The exploit was demonstrated on a Galaxy S21 5G running Android with the scudo allocator, confirming remote code execution in the target process.
What they found 3
- DeltaPerColumn opcode processes planes beyond the image's actual plane count, enabling arbitrary write.
“opcode_last_plane = image_number_of_planes + opcode_number_of_planes; // 3 + 5123 = 5126”
- The exploit uses a TrimBounds opcode to shape the heap before triggering the OOB write.
“Opcode: TrimBounds, minVersion = 1.4.0.0, flags = 1”
- The vulnerability was silently fixed in Samsung's April 2025 security update.
“Curiously, this issue was silently fixed in Samsung’s April 2025 updates.”
Caveats 4
- The authors note that the exploit requires a user to click the image to trigger MediaStore insertion, and they have no evidence of a bypass.
- The fix adds bounds checks that prevent the out-of-bounds plane loop from executing.
- The attack assumes a “1-click” scenario where the victim opens the image; no bypass for automatic download is known.
- Only the scudo-based exploit path is fully detailed; the jemalloc variant is only briefly mentioned.
What’s new here 4
- Identifies a miscalculation of plane bounds in QuramDngOpcodeDeltaPerColumn leading to OOB write.
- Shows how thousands of DNG opcodes can be used for heap shaping on Android's scudo allocator.
- Builds a full JOP chain using crafted MapTable and TrimBounds opcodes to invoke system().
- Provides a detailed, reproducible exploit harness and fixes the bug in Samsung's April 2025 patch.