WebP redaction leak: no 8-pixel fence
Redacting a lossy WebP screenshot still leaks: the redacted-word difference reached the far corner of the frame. JPEG's 8-pixel rule has no WebP equivalent.

The WebP redaction leak is easy to demonstrate and hard to undo. Redacting a JPEG has a known safety margin: whatever you paint over leaves artifacts only inside the 8×8-pixel blocks it touched, so a black box that extends 8 pixels past the glyphs contains the damage. I expected libwebp to behave the same. It does not. In my test, the only difference between a redacted frame that once said YES and one that said NO reached the far corner of a 1280×720 image, 373 pixels from the box, at gray levels no eye would catch.
The setup is deliberately boring. Two frames, identical except that one carries the word YES and the other NO in 160px bold, with lines of body text above and below. I encoded both as lossy WebP at quality 50, painted a black box 2 pixels past the glyph edges, saved the results as lossless PNG, and diffed the pixels. Anything that differs outside the box is something the redaction failed to contain. This reproduces, with numbers I could stand behind, what Thomas Karpiniec’s WebP redaction post showed with amplified pixel diffs.
from PIL import Image, ImageDraw, ImageFont
def frame(word, path):
img = Image.new("RGB", (1280, 720), (245, 245, 245))
d = ImageDraw.Draw(img)
f = ImageFont.truetype("FreeSansBold.ttf", 160)
d.text((60, 240), word, font=f, fill=(20, 20, 20))
box = d.textbbox((60, 240), word, font=f)
img.save(path, quality=50) # lossy WebP
r = Image.open(path).convert("RGB")
ImageDraw.Draw(r).rectangle([box[0] - 2, box[1] - 2,
box[2] + 2, box[3] + 2], fill=(0, 0, 0))
return r
yes = frame("YES", "/tmp/yes.webp")
no = frame("NO", "/tmp/no.webp")
# every pixel where they differ is a pixel the box failed to containWhat the pixel diff showed
JPEG behaves exactly like the folklore says. At quality 50 the JPEG pair differed in 114 pixels outside the box, and the farthest of them sat 2 pixels from the box edge. That is the 8×8 block structure doing its job: each JPEG block decodes from its own quantized coefficients, so a glyph’s ringing cannot escape the blocks it lives in. Widen the box to 8 pixels past the glyphs and the outside count drops to zero. The rule held at quality 75 too, with 118 outside pixels and the same 2px ceiling.
WebP broke that ceiling in every run.
- JPEG, quality 50: 114 pixels changed outside the box, farthest 2px away, max channel delta 61
- JPEG, quality 75: 118 pixels changed, farthest 2px away, max delta 23
- WebP, quality 50: 110,681 pixels changed, farthest 373px away, max delta 1
- WebP, quality 75: 80,182 pixels changed, farthest 373px away, max delta 6
At quality 50 that is about 12 percent of the frame carrying information about what sat under the box. The deltas are small, one to six gray levels, which is why nobody sees anything by eye. Small and deterministic is the problem, though: a forensic diff between two candidate originals reproduces the same fingerprint every run, which is what makes it usable.
Why the WebP redaction leak has no fence
The reason is structural. Lossy WebP is a VP8 keyframe, and VP8 does not decode blocks independently. Each 4×4 prediction unit is reconstructed from its left and top neighbours, and the bitstream stores only the residual between prediction and truth. Chroma rides the same chain, subsampled to 4:2:0, so color edges bleed along with luma. Change one block’s content and you change the predictor that every block to its right and below reads from. Whether a shift survives depends on the quantizer: a shift smaller than the quantization step dies there, a larger one propagates, and with structured content like text there is always another block waiting to inherit it. RFC 6386, the VP8 format spec, describes this prediction chain in detail. The containment property JPEG gets from independent 8×8 transforms is absent by design.
My first run nearly fooled me. With nothing in the frame but the word on white, the WebP pair differed in only 184 pixels outside the box, ceiling 4px. Same encoder, same quality, no fence, and yet almost nothing leaked. Scene content is what turns the missing fence into image-wide spread; add lines of text and the prediction chain has material to carry. That detail matters. A bare test case would leave you believing WebP is fine, and it isn’t.
Resampling does not scrub the leak
I assumed a light resample would destroy the correlation, so I tested that too. Both redacted frames went through a 96 percent Lanczos resize, and the YES-versus-NO difference survived: 97,983 pixels still disagreed, max delta 39. Re-encoding the redacted PNGs as JPEG at quality 90 preserved it as well, with 124,465 pixels of daylight between them. So much for that. The explanation is mundane once you stop thinking of the leak as metadata. The artifact field is not appended to the image; it is baked into pixel values, so any operation that preserves the picture preserves the fingerprint. Resample, re-save, convert, screenshot at 1:1 zoom: none of it resets the pixels to a clean state. A viewer that rescales on draw starts from a raster the encoder never wrote, but a 1:1 viewer hands you the same pixels.
That result killed my favorite mitigation on contact.
If a redaction depends on a containment property the encoder never promised, you don’t have redaction; you have a bet. VP8 makes that bet lose everywhere at once, so the only safe place to redact is before the first lossy save.
The redaction rules that still hold
What still works is boring. Redact at the lossless source: go back to the original screenshot or document, paint the box there, and never let a lossy file that once held the secret become the ancestor of what you publish. If the lossless original is gone, the options get worse, and fast. Rebuild the frame from scratch in an editor, or accept that the redacted image is burned and keep it unpublished, because no repainting erases what VP8 already stored in its neighbours. For JPEG the 8-pixel buffer rule remains valid; my numbers agree with it. For lossy WebP there is no buffer number to publish, because the influence is unbounded. Metadata is a separate problem: Exif tags and color profiles ride along in any container, and no buffer rule scrubs those either.
People who handle documents for a living already work this way. Court filings, briefing slides, incident reports: the discipline is to redact the pristine source and export once, because you cannot audit what a codec did to your pixels afterward. The failure mode I reproduced happens when the lossy file arrives with the damage already inside, which is the normal case for screenshots.
Sharing pipelines make this easy to get wrong, because the lossy step often happens somewhere you don’t control. A chat client or a CMS image pipeline may re-encode to WebP on upload, which means the “original” you later redact is already a lossy derivative. That is the same category error as using Telegram as cloud storage: the format was never built for the job you handed it. Reading the damage afterward is inference from secondary artifacts, the way an ARP table gives you device identity that a DHCP lease won’t. The 1Password breach write-up’s split between what leaked and what didn’t is the right frame here too. The box hides the pixels. Nothing hides their history.
What I would test next
Three probes would tighten this. Does the fingerprint survive a WebP-to-WebP round trip at a different resolution, which is what upload pipelines do all day? Could a classifier trained on YES and NO pairs name the word from a single redacted frame, which would turn the diff into a recovery attack instead of a comparison attack? And how do libwebp’s quality and segmentation knobs change the spread, since the leak’s size is quantizer-dependent? I haven’t run any of those. The practical conclusion doesn’t wait for them: treat every lossy WebP file that ever contained the secret as unreleasable.