Dev.to Security 🔐 Cybersecurity 👁 0 📖 9 min read

Can a Redacted PDF Be Unredacted? I Tested 4 Methods

Yes, often in seconds. Whether a redacted PDF can be unredacted depends entirely on how the redaction was done. A black box drawn on top of the text hides nothing: select it, copy it, paste it into Notepad and the words

Yes, often in seconds. Whether a redacted PDF can be unredacted depends entirely on how the redaction was done. A black box drawn on top of the text hides nothing: select it, copy it, paste it into Notepad and the words are back. A real redaction removes the text under the box, but even then the same name can sit on another page, in the file's properties or in a bookmark.

I didn't want to repeat the usual warnings, so I built a test file and redacted it four different ways, then tried to get the hidden details back out. This is what came back, and how to check your own file before you send it.

The short answer

  • Black rectangle drawn on top: fully recoverable by copy and paste.
  • Black box added as a comment (annotation): fully recoverable. Delete the comment and the text reappears.
  • Real redaction, saved over the original: can be recoverable, because some saves append changes and keep the old version inside the file.
  • Real redaction saved as a new file, or the page burned into an image: the covered text is gone. Anything you didn't cover, including the same details elsewhere in the file, is not.

The test file

A two-page fake payslip: an employee name ("Jane Example"), a National Insurance number with the QQ prefix that is never issued to anyone, and an account number. The name appears again on page 2, in a line about who to contact. The file's Author and Title properties also contain the name, and it has one bookmark, "Jane Example - payslip". That is how real documents look: personal details are rarely in just one place.

I created and checked every version with PyMuPDF (a PDF library for Python), counting how many times each detail could still be extracted as text. The last method was the live Redact PDF tool on this site, run in Chrome.

Results: what came back out

Method Covered text recoverable? Name on page 2 Metadata and bookmark
1. Black rectangle drawn over the text Yes: copy, paste and search all work Still there Still there
2. Black square annotation (comment) Yes: delete the comment and it reappears Still there Still there
3. Real redaction, saved as a new file No Still there Still there
4. Real redaction, saved incrementally Yes: the old version is still inside the file Still there Still there
5. Page burned into an image (Redact PDF tool) No Still there (page not marked) Removed

Only two of the five removed the covered text, and none of them removed the name on page 2, because I hadn't covered it. That last column is the one people forget.

Method 1: a black box on top (copy and paste undoes it)

Most PDF editors let you draw a filled rectangle. It looks perfect on screen and in print. But the page still contains the original text, with the rectangle painted over it. In my test file, all three details were still extractable as text after the boxes went on. Press Ctrl + A, then Ctrl + C, in any PDF viewer, paste into Notepad, and they appear in plain text.

This is how most redaction failures make the news. In January 2019, a court filing by Paul Manafort's lawyers had black bars drawn over the text. Reporters copied and pasted the "redacted" passages and published them the same day. The same thing happens when text is highlighted in black in Word and then saved as a PDF: the highlight is formatting, and the words under it are untouched.

Method 2: a black comment (delete it and the text comes back)

Some apps add the black box as an annotation, the same layer that holds sticky notes and highlights. That is even easier to undo. The text underneath was still extractable, and when I deleted the three annotations the name, NI number and account number were simply visible again on the page. Anyone who opens the comments panel can do the same.

Method 3: the incremental-save trap

This one surprised me most. A PDF can be saved incrementally: instead of rewriting the file, the editor adds the changes to the end, and the original content stays in the file underneath. Viewers only show the newest version.

I applied a real redaction (the kind that removes the text) and saved it that way, onto the original file. Opened normally, the redaction was perfect: no text under the boxes, nothing to copy. But the file now had two "end of file" markers. Cutting it at the first one gave me back the original, unredacted PDF, with every detail intact. No special software is needed, just a text editor and a minute.

I haven't tested which desktop apps save this way and when, so I won't name any. The safe habit is the same either way: after redacting, use Save As and create a new file, rather than saving over the original.

What a real redaction still leaves behind

Method 3, saved as a new file, removed the covered text properly. Method 5, which turns each marked page into an image with the black boxes burned in, did too. Here is what both still exposed, or could:

  • The same details elsewhere. In both files, "Jane Example" was still in the text on page 2. Redaction removes what you cover, not every mention. Search the whole document for each name and number before you finish.
  • File properties. After the real redaction (method 3), the Author and Title fields still said "Jane Example", and so did the bookmark. The Redact PDF tool builds a new file and didn't carry either over: its output had no Author, Title or bookmarks.
  • The file name. The tool names its output after the original plus "-redacted". If the original was called jane-example-payslip.pdf, rename it before you send it.
  • The size of the box. A box exactly the width of a name tells a reader how long the name was. Researchers showed in 2023 that the exact positions of the surrounding letters leak even more, enough to narrow a redacted name down from millions of candidates to a few hundred. Cover the whole field, label to margin, rather than the word alone.
  • Blur and pixelation. These are not redaction. Bishop Fox released a tool, Unredacter, that recovers pixelated text when the font is known. Use solid black.

One more thing from my own test: my first attempt with the tool left "ple" from "Example" and the last digit of the account number showing, because I drew the boxes too tight. On the preview it looked covered. Check the downloaded file, not the preview.

How to check a redacted PDF before you send it

  1. Copy everything. Open the redacted PDF, press Ctrl + A then Ctrl + C (Cmd on a Mac), and paste into Notepad or TextEdit. If a redacted detail appears, the redaction failed.
  2. Search for each detail. Press Ctrl + F and search for every name, number and address you meant to remove, across the whole document.
  3. Extract the text another way. Run the file through PDF to Text, which runs in your browser and doesn't upload the file. It reads every text layer, including the ones a viewer hides.
  4. Open the properties. In most viewers it is File > Properties (Ctrl + D in Adobe Reader). Check Title, Author, Subject and Keywords.
  5. Look at the side panels. Open the bookmarks and comments panels. A bookmark called "Smith v Jones - medical records" undoes a lot of careful redaction.
  6. Check the name of the file you are about to attach.

How to redact so it can't be undone

  • Adobe Acrobat Pro: marking areas is only step one. Nothing is removed until you choose Apply, and that dialog has a Sanitize and remove hidden information option, which also clears metadata, comments and hidden layers. Turn it on. Then save under a new name.
  • Preview on a Mac: use Tools > Redact, not a black shape from the markup toolbar. Apple says the redaction becomes permanent once you close the document. Some users have reported redacted text that was still searchable, so close the file, reopen it, and do the checks above.
  • Free, in the browser: the Redact PDF tool burns the black boxes into an image of each marked page, so there is no text layer under them to recover, and the file never leaves your device. The trade-off: marked pages lose their selectable text, and the file grows. My test file went from 2.7 KB to 52.5 KB, which Compress PDF can bring down. To make the remaining text searchable again, run it through OCR PDF. The black areas stay black.

Whichever you use, cover every mention, cover whole fields rather than single words, save a new file, and run the checks. If the PDF won't let you redact at all because it is restricted, remove the restriction first with Unlock PDF. If you are redacting a photo of a paper document, turn the photo into a PDF first, then redact that.

FAQ

Can redacted PDFs be unredacted?

If the redaction is only a black box or a black comment drawn over the text, yes: the text is still in the file and can be copied, searched or revealed by deleting the box. If the text was really removed, or the page was turned into an image with the boxes burned in, the covered text can't be recovered. But the same details can still be elsewhere in the file: on other pages, in the document properties or in bookmarks.

Can PDF redaction be undone?

A proper, applied redaction saved as a new file can't be undone. It can be undone if it was never applied (Acrobat marks areas first and only removes them when you apply), if it was just a shape or comment, or if the file was saved incrementally. In my test, cutting an incrementally saved file at its first end-of-file marker brought back the original, unredacted version.

How can I tell if a PDF redaction is real?

Select all the text, copy it and paste it into Notepad, then search the PDF for each redacted word. If anything comes back, the redaction is fake. Also check File > Properties for the title and author, the bookmarks and comments panels, and the file name.

Why can I still copy text from a redacted PDF?

Because it was covered, not removed. A black rectangle, a black highlight in Word or a black comment only paints over the text. Redo it with a real redaction tool, starting from the original file.

Is blurring or pixelating text safe for redaction?

No. Security researchers have released tools that recover pixelated text when the font is known. Use solid black boxes, and cover the whole field, not just the word, so its length doesn't give it away.

Does redacting a PDF remove metadata?

Not always. In my test, a real redaction left the author, title and a bookmark containing the person's name. Acrobat Pro can remove hidden information when you apply redactions. The Redact PDF tool on this site builds a new file and didn't carry the metadata or bookmarks over.

Why can't I redact a PDF?

Usually because the free Adobe Reader has no redaction tool (it is part of Acrobat Pro), or because the PDF is restricted against editing. A free browser tool avoids the first problem. For the second, remove the restriction from a file you are entitled to edit, then redact.

Originally published on knowledgemarkg.com.

📰 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.