CSCTF 2026 · Forensics · 395 pts
Afterimage.
An Acropalypse-style crop: the PNG's declared image is smaller than the original, but the original's compressed data is still sitting after the file's own end marker.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Forensics |
| Points | 395 |
| Status | Solved during the event |
| Target | PNG file, offline |
TL;DR. The PNG's IHDR declares a 520×340 image, but 11,911 bytes of leftover compressed data trail the file's IEND marker — the tail of the *original*, larger image's deflate stream, re-used as a scratch buffer by whatever cropped the screenshot. Seeding the deflate window with the visible (cropped) image's own decoded pixels lets the leftover back-references resolve, recovering roughly 200 extra rows of the original.
Challenge
Recover a cropped screenshot's lost region, using nothing but the cropped PNG file itself.
Solution
This is the "Acropalypse" class of bug: an in-place image crop that reuses the same underlying buffer and writes a new, smaller file over it without fully clearing the old data, leaving the tail of the original (larger) image's compressed stream sitting in the file after the new IEND marker. Here, the declared image is 520×340, but 11,911 bytes of extra data trail IEND — framed inside leftover IDAT-style chunk headers, with a deflate sync-flush marker separating the genuine stream from the leftover tail.
Deflate's LZ77 back-references can point into data earlier in the decompression window, including data from a previous deflate block that's no longer part of the visible output — which is exactly what makes this recoverable. Stripping the leftover tail's chunk framing and seeding a 32KB deflate window with the visible (cropped) image's own decoded scanlines — treated as a stored block immediately preceding the leftover stream — lets its back-references resolve correctly against real pixel data instead of garbage.
Decoding roughly 200 additional rows this way and rebuilding a full 520×540 image reveals a region reading "RELAY RECOVERY KEY — ROTATE AFTER USE" with the flag printed directly beneath it.
Flag
CSCTF{6f86acdd1d10e0d8a5a541bb}What I took from it
- An in-place image crop that doesn't zero out the buffer first can leave the compressed tail of the pre-crop image recoverable from the saved file alone — seeding the decompressor's window with the still-visible image's own pixels is the trick that makes the leftover bytes decode to anything at all.