Skip to main content

PDF.js CVE-2026-16633

HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-08-06 https://github.com/mozilla/pdf.js GHSA-hq66-cqwq-w95j
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft PDF with embedded JS payload
  2. Delivery
    Deliver PDF to victim via phishing or upload
  3. Exploit
    Victim opens PDF in vulnerable PDF.js instance
  4. Execution
    PDF scripting engine executes attacker JS
  5. Persist
    Script runs in hosting domain origin
  6. Impact
    Exfiltrate session tokens or perform actions as victim

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Two conditions must both be present: (1) enableScripting is set to true in the PDF.js configuration - this is the default value, so any application that has not explicitly set enableScripting: false is vulnerable; (2) the page hosting PDF.js does not enforce a Content Security Policy that blocks script-src, meaning either no CSP is present or the existing CSP permits inline scripts or unsafe-eval. Exploitation is further conditioned on the victim opening an attacker-controlled PDF document within the vulnerable application, which requires a delivery mechanism such as a malicious upload, phishing link, or compromised document source. Limiting factors include: user interaction is mandatory (the victim must load the PDF), the attacker must control or influence the PDF content loaded by the application, and deployments that have explicitly disabled enableScripting or enforce a strict script-src CSP are not affected regardless of pdfjs-dist version.

Impact

No CVSS vector was provided by NVD or the advisory, so risk signals are inferred. The vulnerability is network-delivered (attacker supplies the malicious PDF), requires no authentication from the attacker, requires only that the victim open the PDF (UI:R), and exploits a default-on configuration - all factors that increase real-world exploitability. The scope change to the hosting domain's origin (equivalent to stored XSS) amplifies impact: a successful exploitation can lead to session hijacking, credential theft, or full account takeover within the application. No EPSS score is available, no CISA KEV listing exists, and no public proof-of-concept code has been identified at time of analysis, which moderates immediate urgency. However, because enableScripting is enabled by default, the fraction of vulnerable deployments is likely high among applications that have not explicitly hardened their PDF.js configuration. The key risk limiter is user interaction: the victim must open the attacker-supplied PDF, which typically requires a social engineering or malicious upload vector.

Exploit ScenarioDerived

An attacker crafts a PDF file containing embedded JavaScript that exfiltrates session cookies or performs actions on behalf of the victim by sending requests to the hosting application. The attacker distributes this PDF via phishing email, a malicious file upload feature, or a shared document link targeting an application that uses pdfjs-dist with default settings. When the victim opens the PDF in the application, the embedded script executes in the hosting domain's origin, granting the attacker the same access as the authenticated user.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
1 PoC candidate (unverified) Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 06, 2026

Arbitrary JavaScript execution in PDF.js (pdfjs-dist) allows an attacker to run unrestricted script in the context of any web application that renders attacker-controlled PDFs with default settings. The flaw stems from PDF.js's built-in scripting engine, which is enabled by default via the enableScripting flag, executing embedded JavaScript from PDFs without sandbox enforcement when no script-src CSP is present. Applications using pdfjs-dist versions 5.6.83 through 6.2.107 are affected; no public exploit or KEV listing is identified at time of analysis, but the default-on configuration makes real-world exposure broad.

RemediationAI

The primary fix is to upgrade pdfjs-dist to version 6.2.108 or later, as confirmed by the GHSA advisory at https://github.com/mozilla/pdf.js/security/advisories/GHSA-hq66-cqwq-w95j. If an immediate upgrade is not feasible, two compensating controls are available. First, set enableScripting to false when initializing PDF.js - this disables the PDF scripting engine entirely and prevents JavaScript embedded in PDFs from executing; the trade-off is that AcroForm interactive scripts and some form features in PDFs will no longer function. Second, configure a Content Security Policy with a restrictive script-src directive (e.g., script-src 'self') on the page hosting PDF.js - this will block inline script execution injected by the PDF engine even if enableScripting remains true, though this requires careful CSP tuning to avoid breaking other page functionality. Combining both mitigations is recommended until the patch can be applied.

Affected Packages

npm pdfjs-dist fix: 6.2.108

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PDF.js (distributed as pdfjs-dist on npm, CPE: pkg:npm/pdfjs-dist) is Mozilla's JavaScript-based PDF renderer, widely embedded in web applications to display PDF files without plugins. It optionally supports PDF-level JavaScript via an AcroForm/PDF scripting engine, controlled by the enableScripting configuration flag, which defaults to true. CWE-79 (Improper Neutralization of Input During Web Page Generation - Cross-Site Scripting) is the root cause: attacker-controlled JavaScript embedded in a PDF document is executed within the hosting page's origin when the PDF is loaded. Because the script runs in the DOM context of the hosting domain rather than an isolated sandbox, it has full access to the page's cookies, local storage, session tokens, and can perform arbitrary DOM manipulation. The absence of a restrictive Content Security Policy (script-src) is a compounding factor, as a suitable CSP could block execution even when enableScripting is true.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

vuln.today AI 9.3 CRITICAL

Network-delivered PDF, no attacker privileges, user must open it (UI:R), JS executes in hosting origin (S:C), with full read/write access to that context.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

DescriptionCVE.org

Impact

If PDF.js is used to load a malicious PDF, and PDF.js is configured with enableScripting set to true (which is the default value) and no CSP for disallowing script-src, unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.

Patches

Workarounds

Set enableScripting to false or set a CSP.

Latest POC

1 PoC candidate from github (unverified)

Sign in to open the public PoC links collected for this CVE.

Executive ViewAI

Why It Matters

PDF.js library versions 5.6.83-6.2.107 contain a vulnerability allowing malicious PDFs to execute arbitrary code within web applications, potentially leading to data theft, system compromise, or fraud. Organizations using affected versions face significant risk through routine document handling and sharing. With no patch currently available, immediate remediation actions are required.

Business Impact: High
Compensating Controls

Disable the enableScripting flag in pdfjs-dist configuration if not required for application functionality. Implement restrictive Content Security Policy (CSP) headers with script-src 'none' or allowlist-only directives to prevent arbitrary script execution. Restrict PDF upload and processing to authenticated, trusted sources only. Monitor PDF.js maintainer security advisories for patch availability.

Threat Intelligence Overview

Prevalence
High
pdfjs-dist is a top npm package with tens of millions of weekly downloads
Threat Intel
1
1 source
Data Quality
2 sources
Confidence: Low
CVE.org GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

Priority Score

20
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: 0
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

pkg:npm/pdfjs-dist

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy