Dev.to Security ๐Ÿ” Cybersecurity ๐Ÿ‘ 1 ๐Ÿ“– 1 min read

Why Drawing Black Boxes Over a PDF Leaks Sensitive Text (and How Offline Pixel Burn-In + Re-OCR Audit Solves It)

High-profile court filings and FOIA releases still fail every year for the same reason: someone opened a PDF editor, drew opaque black rectangles over names or SSNs, saved the file, and emailed it out. Anyone who presse

High-profile court filings and FOIA releases still fail every year for the same reason: someone opened a PDF editor, drew opaque black rectangles over names or SSNs, saved the file, and emailed it out.

Anyone who presses Ctrl+A and Ctrl+C (or runs pdftotext) still extracts every word underneath those boxes โ€” along with Author, Creator, XMP history, and annotation layers.

What forensic-grade offline redaction actually requires

  1. True pixel burn-in (150โ€“300 DPI): Render each page onto an HTML5 Canvas, paint solid black over the selected bounding boxes so the original glyphs never exist in the pixel buffer, and rebuild a clean PDF from the flattened raster pages.
  2. Metadata & EXIF stripping: Clear Info dictionary entries (Author, Title, Creator, Producer), drop XMP streams, AcroForm fields, bookmarks, and annotations โ€” and strip EXIF GPS/device headers when importing scanned photos (PNG/JPG/WebP).
  3. Automated second-pass + Re-OCR verification: Re-open the generated PDF bytes in a fresh parser pass (VERIFIED ยท 0 Leaked Text) and run Re-OCR Verify Output using self-hosted in-browser LSTM WASM OCR (tesseract.js + same-origin eng.traineddata.gz) to prove zero sensitive targets survive even in the flattened pixels.

Try it offline in your browser (zero uploads)

(Disclosure: Built independently at Lukas Labs.)

๐Ÿ“ฐ Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.