NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

CVE-2024-34342 — react-pdf

HIGHFix: mozilla/pdf.js@85e64b5

CVE-2024-34342 is a high-severity (CVSS 7.1) Cross-site Scripting (XSS) vulnerability in react-pdf. A fix is available for react-pdf — see the affected versions and patch details below.

react-pdf's PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF

Also known asGHSA-87hq-q4gp-9wr4
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Nov 3, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • A successful exploit gives an attacker total control of the affected component, not partial access.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2024-34342.

EPSS Exploitation Probability

via FIRST.org ↗
1.1%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs65th percentile — riskier than 65% of all scored CVEsHighest risk
0.00%2.07%4.15%6.22%5.0%1.1%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

2 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

1Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
react-pdfnpm
9.3Mdownloads / week

Description

Summary

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

Patches

This patch forces isEvalSupported to false, removing the attack vector.

Workarounds

Set options.isEvalSupported to false, where options is Document component prop.

References

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npmreact-pdfall versions7.7.3npm install react-pdf@7.7.3
📦npmreact-pdf≥ 8.0.0&&< 8.0.28.0.2npm install react-pdf@8.0.2

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for react-pdf, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update react-pdf to 7.7.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-34342 is resolved across your whole dependency graph.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

Frequently Asked Questions

### Summary If PDF.js is used to load a malicious PDF, and PDF.js is configured with `isEvalSupported` set to `true` (which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain. ### Patches [This patch](https://github.com/wojtekmaj/react-pdf/commit/671e6eaa2e373e404040c13cc6b668fe39839cad) forces `isEvalSupported` to `false`, removing the attack vector. ### Workarounds Set `options.isEvalSupported` to `false`, where `options` is `Document` component prop. ### References - [GHSA-wgrm-67xf-hhpq](https://github.com/mozilla/pd
O3 Security · Impact-Aware SCA

Is CVE-2024-34342 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2024-34342: react-pdf — Fixed in 7.7.3