Why PDFs Are Dangerous
PDFs look harmless. They are not. The PDF specification supports JavaScript execution, embedded executable files, auto-launch actions and form fields that connect to external servers. A weaponized PDF can install malware the moment you open it.
Most PDF viewers execute active content by default. Adobe Acrobat Reader runs JavaScript automatically. Browser-based viewers disable some features but still render the document. If you receive a PDF from an unknown sender, opening it in a standard viewer is a risk. For a deeper look at PDF threats, read why every PDF is a security risk.
Method 1: Use a Viewer That Never Runs PDF Code (Recommended)
Sherlock Forensics PDF Viewer + Editor is a free application for Windows and Linux that never runs a PDF's code. Its pure Rust parser (lopdf) reads the text, structure and metadata without executing JavaScript, auto-launch actions or embedded executables. Pages are rendered only when you click Render.
What gets blocked automatically:
- JavaScript execution
- Embedded executable files (.exe, .bat, .ps1)
- Auto-launch and auto-open actions
- External URL connections from form fields
- Malicious annotation actions
Threat inspector flagging suspicious elements in a PDF (click to enlarge)
If you need to verify digital signatures or redact sensitive content, the Pro Edition is $29/year. The parse-first model is explained below.
Method 2: Disable JavaScript in Adobe Reader
If you already have Adobe Acrobat Reader installed, you can reduce the risk by disabling JavaScript:
- Open Adobe Reader and go to Edit > Preferences.
- Select JavaScript from the left panel.
- Uncheck Enable Acrobat JavaScript.
- Click OK.
This blocks JavaScript-based attacks but does not stop embedded executables, auto-launch actions or malicious form fields. It also does not survive Adobe Reader updates, which sometimes re-enable JavaScript. Most users forget to check this setting after updates.
Method 3: Use Your Browser's Built-in Viewer
Chrome, Edge and Firefox all have built-in PDF rendering. These viewers are generally safer than Adobe Reader because they disable most JavaScript execution and run in the browser's sandbox.
Limitations: browser viewers cannot handle all PDF features (forms, annotations, digital signatures). They also do not give you visibility into what the PDF contains under the surface. You see the rendered output but not the threats hiding in the document structure.
What to Look for in a Suspicious PDF
Before opening any PDF from an unknown source, check for these red flags:
- Unexpected sender. Did you expect this document? Is the email address legitimate?
- Urgency language. "Invoice overdue", "legal notice", "account suspended" are common social engineering tactics.
- Unusual file size. A one-page invoice that is 5MB may contain embedded payloads. A 200-byte PDF is likely malformed.
- Requests to enable content. Any PDF that asks you to "enable editing", "allow permissions" or "click to view" is suspicious.
Need to read email archives securely? See how to open PST files without Outlook. Securing endpoints? Learn how to block USB drives on Windows.
How a Parse-First Viewer Works
Sherlock Forensics PDF Viewer + Editor splits opening a PDF into two steps:
- Safe parse (automatic). lopdf, a pure Rust PDF library, reads the file into an object tree. There is no JavaScript engine, no URL handler and no action executor in this step.
- Visual render (explicit click only). When you decide the file is safe, click Render. Pdfium, Chrome's PDF engine, handles layout in an isolated context. Critical threats trigger a red banner and rendering is blocked.
Between the two steps the Threat Inspector lists what the PDF wants to do:
- Every URL, with phishing patterns, homograph domains and URL shorteners flagged
- JavaScript, extracted for reading and never run
- /Launch, /GoTo, /GoToR, /SubmitForm and /ImportData actions with their targets
- Embedded files and XFA forms
Parse-first vs a sandbox. Windows Sandbox or a VM lets the malicious code run and tries to contain it. A parse-first viewer never runs it, so there is nothing to contain. For forensic work you need to analyze the threat, not experience it.
No outbound traffic. The application makes no network connections: no telemetry, no update checks, no license validation and no DNS queries. That suits air-gapped forensic workstations.
Antivirus and a Safe Viewer Cover Different Threats
Antivirus checks a file against signatures and behavior rules after it lands on disk. It is good at known malware. A PDF that uses the format's own features is valid PDF, so it can pass a scan.
| Threat in the PDF | Antivirus | Parse-first viewer |
|---|---|---|
| Known malware payload | Caught if a signature matches | Embedded file listed; never opened |
| /URI to a credential-harvesting page | Often treated as normal content | URL extracted and flagged |
| JavaScript in /OpenAction | Caught if it matches known exploit code | Never run; shown for review |
| /Launch or /SubmitForm action | Valid PDF structure; may pass | Listed with its target |
| New exploit with no signature | No signature to match | Code never runs |
Keep both. Antivirus covers the known; the viewer covers what the file is built to do. Layered controls are the defense-in-depth approach in the NIST Cybersecurity Framework. For how these attacks work, read why every PDF is a security risk.
Frequently Asked Questions
Can a PDF give you a virus?
Yes. PDFs can contain JavaScript that executes when the file opens, embedded executable files that auto-launch and malicious form actions that connect to external servers. Most PDF viewers execute these by default. A viewer like Sherlock Forensics PDF Viewer + Editor never runs the PDF's code, so none of it fires.
Is it safe to open PDFs in Chrome?
Chrome's built-in PDF viewer is safer than Adobe Reader because it disables most JavaScript execution. However it is not a full sandbox. It still renders the PDF and may process certain embedded elements. For unknown or suspicious PDFs, a viewer that never runs the PDF's code and renders only on request gives stronger protection.
What is the safest PDF viewer?
A viewer that blocks all active content by default: JavaScript, embedded executables, auto-launch actions and external connections. Sherlock Forensics PDF Viewer + Editor uses a pure Rust parser that does not execute any active content. It renders pages only when you click Render.
