Vulnerabilities in pkg:npm/pdfjs-dist

PACKAGE
Advisory Identifier: GHSA-hq66-cqwq-w95j
Advisory Summary

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

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/pdfjs-dist

3 Known Advisory Record(s)

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

CVE Identifier CVE-2026-16633
GHSA Identifier GHSA-hq66-cqwq-w95j
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Pdfjs dist
Package Ecosystem npm
Published Date
Last Updated

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.

pdfjs-dist fixed: 6.2.108
npm install pdfjs-dist@6.2.108
Verify Direct and Transitive Dependencies

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

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

CVE-2026-16633 Affected Pdfjs dist Versions

1 component(s)
Fixed Versions:
6.2.108
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?
CVE-2026-16633 is a security vulnerability in Pdfjs dist involving Arbitrary JavaScript execution upon opening a malicious PDF under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Pdfjs dist versions are affected?
Affected versions include releases prior to 6.2.108 across affected packages: pdfjs-dist.
What version fixes CVE-2026-16633?
Upgrading to 6.2.108 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pdfjs-dist affected?
Yes, pdfjs-dist is affected in releases prior to 6.2.108. Upgrade your dependency to 6.2.108 or later.
What CWE is associated with CVE-2026-16633?
CVE-2026-16633 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for CVE-2026-16633?
Run the dependency tree command: 'npm ls pdfjs-dist'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}