react-pdf's PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · High · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
react-pdf displays PDFs in React apps. 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. This vulnerability is fixed in 7.7.3 and 8.0.2.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| wojtekmaj | react-pdf | before 7.7.3; 8.0.0 to before 8.0.2 | 7.7.3, 8.0.2 | Patch available | CNA |
| — | react-pdf (npm) | before 7.7.3 | 7.7.3 | Patch available | GHSA-87hq-q4gp-9wr4 |
| — | react-pdf (npm) | 8.0.0 to before 8.0.2 | 8.0.2 | Patch available | GHSA-87hq-q4gp-9wr4 |
- react-pdf Vendorwojtekmaj Affected before 7.7.3; 8.0.0 to before 8.0.2 Fixed in 7.7.3, 8.0.2 Patch available CNA
- react-pdf (npm) Vendor— Affected before 7.7.3 Fixed in 7.7.3 Patch available GHSA-87hq-q4gp-9wr4
- react-pdf (npm) Vendor— Affected 8.0.0 to before 8.0.2 Fixed in 8.0.2 Patch available GHSA-87hq-q4gp-9wr4
CPE names CISA-ADP · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:pdf.js_viewer_project:pdf.js_viewer:*:*:*:*:*:wordpress:*:* | — | — | Pdf.js Viewer Project |
- cpe:2.3:a:pdf.js_viewer_project:pdf.js_viewer:*:*:*:*:*:wordpress:*:* Versions — — ·Pdf.js Viewer Project
Remediation
- Fix · CNA react-pdf (wojtekmaj) Fixed in 7.7.3, 8.0.2
- Fix · GHSA-87hq-q4gp-9wr4 react-pdf (npm) Fixed in 7.7.3 Advisory →
- Fix · GHSA-87hq-q4gp-9wr4 react-pdf (npm) Fixed in 8.0.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-34342
- 2026-10-03 Alias added: GHSA-87hq-q4gp-9wr4
References
Other 7
- https://github.com/wojtekmaj/react-pdf/security/advisories/GHSA-87hq-q4gp-9wr4
- https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq
- https://github.com/mozilla/pdf.js/pull/18015
- https://github.com/mozilla/pdf.js/commit/85e64b5c16c9aaef738f421733c12911a441cec6
- https://github.com/wojtekmaj/react-pdf/commit/208f28dd47fe38c33ce4bac4205b2b0a0bb207fe
- https://github.com/wojtekmaj/react-pdf/commit/671e6eaa2e373e404040c13cc6b668fe39839cad
- https://github.com/wojtekmaj/react-pdf
Sources
- CVE-2024-34342 · CVE Program
- CVE-2024-34342 · NVD
- FIRST EPSS
- GHSA-87hq-q4gp-9wr4 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences