Yes, a PDF can contain malicious code, embedded files, or phishing links. Opening one can exploit a vulnerable reader; following a link can lead to credential theft without installing anything. But downloading a PDF, previewing it, entering a password, and running a program from it are different situations. A PDF-looking icon or a clean scan alone cannot tell you which risk applies.
If a security tool flags the file, keep it quarantined while you verify its source. Do not upload private financial, medical, payroll, or tax documents to public scanners. Use the situation below to choose what to check next.
PDF Safety Check: Which Situation Are You In?
Choose the furthest action you took. If a browser or email app automatically displayed the PDF, use the opened or previewed branch.
- Downloaded only, never displayed: leave it closed, verify the sender, and scan the file locally. Delete an unwanted suspicious copy; downloading alone is not evidence that malware ran.
- Opened or previewed, without clicking: close it, check that the reader/browser is updated, and scan the file. Record any security warning. Rendering is not the same as running a downloaded program, but it does process the PDF.
- Clicked a link or scanned a QR code: close the destination and check whether anything downloaded. Do not sign in through that page; visit the organization through your usual bookmark or app.
- Entered a password, approved a sign-in, or granted an app account access: use a trusted device to secure that account. Revoke suspicious sessions and app/OAuth permissions; change an exposed password and enable MFA. A clean PDF scan does not undo account access.
- Ran a downloaded program, installed an app, or see new alerts: follow the device-cleanup steps below. If malware execution is confirmed or credibly suspected, also secure affected accounts from a trusted device; do not wait for visible misuse. On a work device, report the document and your actions to IT.
- A website rejected your upload: use the rejected-upload checks; a portal’s script restriction is not the same as a confirmed infection.
Can a PDF Have a Virus?
A PDF is a document format, not an executable program by default. That is why many people treat PDFs as safer than EXE, BAT, or script files. The problem is that PDFs are not always static images of text. They can contain interactive forms, embedded files, clickable links, JavaScript actions, and metadata that a reader application must parse. Adobe’s public PDF-safety guidance notes that PDFs can be abused through JavaScript, hidden objects, phishing links, and other malicious content [1].
In everyday language, people say “PDF virus” for several different threats: a malicious PDF that exploits a reader bug, a PDF that uses JavaScript to trigger a download, a document that hides a phishing link, or a file named like invoice.pdf.exe to fool users who hide file extensions. The result can be malware, credential theft, spyware, or a trojan downloader.
Why Attackers Still Use PDF Files
PDFs are trusted in daily work. People expect invoices, resumes, contracts, tax forms, delivery notices, and manuals to arrive as PDF attachments, so attackers use that familiarity to lower suspicion. A malicious PDF can also look clean during a quick preview because the real danger may be a link, button, or script that activates only after the user interacts with the document.
How PDFs Become Malicious
- Embedded JavaScript: Runs document actions, opens URLs, changes form behavior, or tries to abuse an outdated reader.
- Old form with scripts: May contain legitimate form logic, stale XFA/actions, or exploit-like JavaScript that security tools label as
PDF.Exploit.JS. - Reader exploit: Uses a vulnerability in Adobe Acrobat, a browser PDF viewer, or another reader to execute code.
- Hidden attachment: Packs another file inside the PDF, such as a script, archive, or executable payload.
- Phishing link or form: Sends the user to a fake login, payment, delivery, or document portal.
- Double extension trick: Names an executable file like a PDF so Windows shows it as a harmless document.
Embedded JavaScript and Actions
JavaScript in PDFs is legitimate when it supports forms or document automation. Attackers abuse the same feature to open external URLs, display fake prompts, or try to trigger behavior in the PDF reader. Acrobat restricts potentially unsafe actions through its security settings; trusting a document or adding an exception can relax those restrictions. JavaScript can also be disabled when the workflow does not need it [5].
When Old Forms Trigger PDF.Exploit.JS
A PDF.Exploit.JS alert does not automatically mean a bank, insurance, HSA, beneficiary, assessment, or tax document was created by an attacker. Older interactive PDFs can include JavaScript, XFA form logic, submit buttons, launch actions, or unusual objects that modern scanners treat cautiously. The risk decision is different from a random invoice attachment: you may need the record, but you should not trust the flagged copy blindly.
- Old financial, insurance, medical, or tax PDF flagged as
PDF.Exploit.JS: Keep it quarantined, scan locally, update the PDF reader, and download a fresh copy from the official bank, insurer, employer, or tax portal when possible. - The PDF came from an email, archive, file-sharing link, or unknown sender: Treat it as suspicious, do not click form buttons or links, and use the phishing/malware cleanup path below.
- The PDF is sensitive and contains account, payroll, health, tax, or customer data: Do not upload it to a public multi-scanner. Use local security software or ask the issuing organization for a clean replacement.
- The alert returns after deletion or another file/process appeared: Scan the device for persistence and review downloads, startup entries, browser changes, and recently installed apps.
If the document is only an archived record, deleting the flagged copy and restoring it from the official source is usually safer than trying to “repair” it. If it is irreplaceable, keep the flagged copy quarantined and record the detection name, file source, and date. Ask the issuing organization or your security team to assess the record or provide a readable replacement. Do not restore it, add an antivirus exclusion, or click a trust override just to recover its contents; an updated reader reduces risk but does not clear the alert.

Modern malicious PDFs often rely on user interaction rather than automatic infection. In 2025, Varonis documented MatrixPDF, a toolkit that can add blurred overlays, fake “Open Secure Document” prompts, JavaScript actions, and redirect buttons to ordinary-looking PDFs [3]. In Varonis’s Gmail-preview example, the viewer does not execute the PDF’s JavaScript, but a clickable overlay still takes the user to an external site. The document can therefore act as a lure even when the later malicious download is not inside the PDF.
If Microsoft Defender names the file Trojan:PDF/Phish.A, use our Trojan:PDF/Phish.A removal guide for the quarantine, clicked-link, and repeat-alert path. For email-lure patterns around fake invoices and shared documents, compare the message against our phishing email warning signs.

Phishing Links in PDF Files
A malicious PDF does not need to exploit software to be dangerous. It may simply contain a convincing button or link that opens a fake Microsoft 365, bank, courier, payroll, or invoice page. Browser and security-tool warnings can help, but they do not make every PDF link safe. Verify an unexpected document with the sender through a separate, known contact channel.

Outdated PDF Readers
PDF readers and browser PDF viewers process complex file structures. If the reader is outdated, a malicious document may exploit a known vulnerability. This is why protected mode, protected view, browser sandboxing, and regular updates matter. In Adobe Acrobat/Reader, keep the available sandbox protections enabled. Protected Mode limits system access; Protected View provides additional restrictions for untrusted documents. Selecting Enable All Features exits Protected View, so it is a trust decision, not a virus check [2].
Browser add-ons can create a separate exposure even when no suspicious PDF is opened. The patched Adobe Acrobat Chrome extension flaw affecting WhatsApp Web is a useful reason to check extension versions as well as the desktop PDF reader.
Signs a PDF May Be Malicious
- The PDF arrives unexpectedly, especially as an invoice, delivery notice, legal document, resume, refund note, or shared file.
- The sender address, domain, or message wording does not match the organization it claims to represent.
- The file asks you to click “Open Secure Document”, “Enable Content”, “View Invoice”, or a similar button.
- The document opens a browser tab, download prompt, login page, or permission dialog.
- The link target does not match the visible company name when you hover over it.
- The file name uses a double extension, such as
statement.pdf.exeorinvoice.pdf.scr. - The PDF reader warns about JavaScript, external connections, embedded files, or untrusted content.
- Your security tool flags the PDF, the download URL, or a process launched after opening it.
How to Check a PDF for Viruses Before Opening It
- Verify the sender and full filename. Confirm an unexpected attachment through a separate channel. In Windows File Explorer, show file name extensions and check that the file ends in
.pdf, not.pdf.exeor.pdf.scr. An icon is not a file-type check. - Scan without opening the document. With Microsoft Defender active on Windows, right-click the saved PDF, select Show more options if needed, then Scan with Microsoft Defender. Wait for the result [4]. If another security product is active, use its file-scan function. Do not restore a quarantined file just to perform this step.
- Choose local scanning for private records. For a non-confidential document, the Gridinsoft Online Virus Scanner is another checking option. Keep contracts, payroll, medical, insurance and tax files local; see our public file-scanner privacy guide before submitting a document to an online service.
- Read the result in context. A detection needs quarantine and source verification. “No threats found” means the scanner did not detect a threat; it does not certify the PDF’s links, a later download, or the sender’s identity. An unscanned or password-protected item is not a clean result.
- Use a current protected reader only after resolving doubts. If the source remains unverifiable or an alert unresolved, request a fresh copy from the official portal. Do not click a document’s “unlock,” login or download button to make it readable.
Check Adobe Acrobat’s protections before handling documents
In current Windows Acrobat, open Menu → Preferences → Security (Enhanced) and keep Enable Enhanced Security selected. Keep Protected Mode enabled and use Protected View for untrusted documents where your edition provides it. Product and platform controls differ; on a managed computer, ask IT about unavailable settings.
If your workflow does not need PDF scripts, open Preferences → JavaScript and clear Enable Acrobat JavaScript [5]. Some legitimate forms will lose calculations or buttons. Do not compensate by trusting an unknown document or adding its folder to privileged locations. These controls restrict behavior; they do not disinfect a flagged file. Links can still lead to phishing even when JavaScript is disabled.
“Uploaded PDF contains executable scripts or malicious content”: what to do
If a portal says your uploaded PDF contains executable scripts or malicious content and cannot be accepted, first identify which service rejected it and whether your antivirus separately reported a threat. The wording alone cannot establish infection. A portal may reject active features it does not accept: OnBoard, for example, documents that even empty JavaScript placeholders can trigger its security checks [6]. That example does not identify the cause of every portal’s error.
- Your antivirus also flags the PDF: keep quarantine and use the issuer/replacement route above. Do not open or convert the flagged copy to get around the rejection.
- You created it from a trusted source document: ask the receiving service which PDF features it accepts, then export a new copy from the original source with those settings. Keep the original signed or interactive version.
- The issuer supplied it: ask the issuer for a compatible copy, or send the portal’s support team the exact error and document type. Use an approved private support channel if the document contains sensitive data.
Print-to-PDF or flattening may remove interactive features, but can also change forms, links or signature validity. Neither is a guarantee of malware removal. Do not disable a site’s security checks or upload the same private file to a series of public converters.
What to Do If You Opened a Suspicious PDF
For a business-email example where a fake protected PDF viewer asks for mailbox credentials, see the Revised Invoice email scam and handle it as a password-theft incident, not only a file-safety question.
- Close the PDF and any page it opened. Do not approve prompts, downloads, macro-like actions, or login requests.
- Disconnect if there are signs software ran. If an unexpected program launched, a terminal flashed, or new security alerts appeared, disconnect from the network and contact IT on a managed device. A download that stayed unopened needs file checking; it does not by itself prove execution.
- Run a full scan on an affected Windows PC. If software ran or alerts persist, download/install Gridinsoft Anti-Malware from its official site, update it, run a Full Scan, review detections and apply the selected cleanup. Restart and check whether new alerts or the original symptom return.
- Secure affected accounts from a trusted device. If you entered credentials, approved a suspicious sign-in, granted an app/OAuth access, or have credible evidence that malicious software ran, act without waiting for visible account misuse. Revoke suspicious app permissions and active sessions as appropriate, change exposed passwords, and enable MFA. For suspected credential-stealing malware, prioritize accounts used or stored on the affected device. Contact IT for work accounts. A password reset alone may not revoke an app grant or an existing session; device cleanup alone does not secure the account.
- Follow up if symptoms remain. Check the exact new detection and recent downloads or installed apps. Manual startup/task inspection is an optional targeted follow-up, not a required second cleanup sequence for every PDF.
- Report the message. Forward the suspicious email to your IT/security team, mail provider, or the organization being impersonated.
On Windows, if a program launched through the PDF or new security alerts return after deletion, a local scan is easier than manually chasing every leftover. Gridinsoft Anti-Malware checks detections, hidden files, startup entries, scheduled tasks, bundled apps, browser changes, and other persistence points that can survive after the visible PDF is gone.
Can You Get Infected Just by Downloading a PDF?
Usually, saving a PDF without displaying it is less risky than opening it, clicking its links, or allowing actions. If your browser opened the PDF in a tab, or your email app showed a document preview, a viewer has already rendered it; that is not the download-only case. The danger increases when a PDF reader parses the file, when the user interacts with a malicious prompt, or when another file hidden behind the PDF name is actually executed. Still, if the file came from a suspicious source, scan it before opening and delete it if the sender cannot be verified.
Are PDFs Safer on Phones?
Phones are not immune. Mobile PDF viewers are sandboxed, but PDF phishing still works on iPhone and Android because the attack may only need a click to open a fake login page. Keep the OS and apps updated, avoid installing APKs, configuration profiles or apps offered by a PDF link, and do not enter passwords into pages opened from an unexpected document. If you only previewed it, close it and check for alerts or unexpected downloads; that alone is not a reason to assume your phone is infected. If you entered credentials, approved a sign-in or granted account access, follow the account-recovery branch regardless of the phone model.
If a PDF link led to an Android app installation, use Trojan Scanner for Android to scan the installed apps, review findings and confirm unwanted-app removal. The concern here is the installed app; a password submitted on a linked page still needs account recovery.
How to Reduce PDF Virus Risk
- Keep Windows, browsers, Adobe Reader/Acrobat, and other PDF readers updated.
- Use Protected View, Enhanced Security, and browser sandboxing for files from the internet.
- Disable PDF JavaScript unless you need it for trusted business forms.
- Do not open unexpected invoices, resumes, legal notices, or delivery documents without verifying the sender.
- Hover over PDF links before clicking, and avoid shortened URLs or domains that do not match the claimed company.
- Use endpoint protection that scans downloaded files, URLs, and suspicious behavior.
- Back up important files so a malware incident does not become a data-loss incident.
FAQ
Can a PDF have a virus if it only contains text?
It is less likely, but appearance alone is not enough. A PDF that looks like plain text can still contain hidden links, objects, scripts, or malformed structures. Scan unexpected files and use a protected reader.
Can opening a PDF install malware automatically?
It is possible, especially with an outdated or vulnerable reader, but many current attacks require a click, permission prompt, or redirect. Keep readers updated and do not approve actions requested by an unexpected document.
Can a PDF steal passwords?
Yes, commonly through phishing. The PDF may link to a fake login page or show a button that pretends to unlock a secure document. If you entered credentials, change them from a clean device and enable MFA.
Should I scan every PDF?
You do not need to scan every trusted document from a known workflow, but you should scan PDFs from unknown senders, unexpected emails, public downloads, file-sharing links, or messages that create urgency.
What should I do if antivirus says PDF.Exploit.JS?
Quarantine the file first. If it is an old sensitive form or statement, scan it locally, update your PDF reader, and try to download a fresh copy from the original organization. Do not upload private financial, medical, payroll, or tax PDFs to public scanners just to verify the alert.
Can a PDF virus affect Mac or Android?
Yes, but the risk depends on the exploit, viewer, and user action. Even when malware execution is harder, phishing links and fake login pages work across Windows, macOS, iPhone, and Android.
References
- Adobe. “Can PDFs have viruses? Keep your files safe.” Adobe Acrobat Resources. Accessed November 5, 2026. Can PDFs have viruses? Keep your files safe
- Adobe. “Protected View and Protected Mode overview.” Adobe Acrobat Help, May 13, 2026. Accessed November 5, 2026. Protected View and Protected Mode overview
- Daniel Kelley. “MatrixPDF Puts Gmail Users at Risk with Malicious PDF Attachments.” Varonis, September 30, 2025. Accessed November 5, 2026. MatrixPDF Puts Gmail Users at Risk with Malicious PDF Attachments
- Microsoft. “Scan an item with Windows Security.” Microsoft Support. Accessed November 5, 2026. Scan an item with Windows Security
- Adobe. “JavaScript Controls.” Acrobat Desktop Application Security Guide. Accessed November 5, 2026. JavaScript Controls
- Andrew Sompels. “Removing JavaScript from PDFs.” OnBoard Help Center, May 1, 2026. Accessed November 5, 2026. Removing JavaScript from PDFs

