Vulnerabilities in pkg:npm/pdfjs-dist
PACKAGECVE-2026-16633 is a HIGH arbitrary javascript execution upon opening vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Pdfjs dist libraries in the npm ecosystem. The issue involves arbitrary javascript execution upon opening a malicious pdf. Remediation is available by upgrading affected packages to version 6.2.108.
pkg:npm/pdfjs-dist
Vulnerability advisories affecting package pkg:npm/pdfjs-dist. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-hq66-cqwq-w95j | CVE-2026-16633 | HIGH | PDF.js: Arbitrary JavaScript execution upon opening a malicious PDF |
| GHSA-wgrm-67xf-hhpq | CVE-2024-4367 | HIGH | PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF |
| GHSA-7jg2-jgv3-fmr4 | CVE-2018-5158 | HIGH | Malicious PDF can inject JavaScript into PDF Viewer |
CVE-2026-16633 at a Glance
How to Fix CVE-2026-16633
To remediate this vulnerability, upgrade all affected Pdfjs dist dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install pdfjs-dist@6.2.108
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls pdfjs-dist
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-16633, inspect your project dependencies using npm:
npm ls pdfjs-dist
Analyze the terminal output to locate any version of Pdfjs dist in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.2.108), your application is affected.
Note: The npm ls pdfjs-dist command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Pdfjs dist, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-16633 Affected Pdfjs dist Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pdfjs-dist
|
npm |
≥ 5.6.83
< 6.2.108
|
6.2.108
|
References
Frequently Asked Questions
What is CVE-2026-16633?
Which Pdfjs dist versions are affected?
What version fixes CVE-2026-16633?
Is pdfjs-dist affected?
What CWE is associated with CVE-2026-16633?
How can I check npm dependencies for CVE-2026-16633?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hq66-cqwq-w95j",
"modified" : "2026-08-06T21:12:27Z",
"published" : "2026-08-06T21:12:27Z",
"aliases" : [ "CVE-2026-16633" ],
"summary" : "PDF.js: Arbitrary JavaScript execution upon opening a malicious PDF ",
"details" : "### Impact\n\nIf 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.\n\n### Patches\n\n### Workarounds\nSet `enableScripting` to `false` or set a CSP.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "pdfjs-dist"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.6.83"
}, {
"fixed" : "6.2.108"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mozilla/pdf.js/security/advisories/GHSA-hq66-cqwq-w95j"
}, {
"type" : "WEB",
"url" : "https://bugzilla.mozilla.org/show_bug.cgi?id=2055885"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mozilla/pdf.js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-06T21:12:27Z",
"nvd_published_at" : null
}
}