CVE-2024-34342 json
react-pdf's PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF
published 2y ago modified 4mo ago also EUVD-2024-1513 , GHSA-87hq-q4gp-9wr4
- cvss
- 7.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.1%
- EPSS 1.1% chance of exploitation in 30 days, percentile 65%
- public exploits
- 0
- none known
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.
Patch / fix
- npm react-pdf 7.7.3, 8.0.2
- github.com/mozilla/pdf.js@85e64b5 commit
- github.com/wojtekmaj/react-pdf@208f28d commit
- github.com/wojtekmaj/react-pdf@671e6ea commit
- github.com/mozilla/pdf.js#18015 pull request
Is CVE-2024-34342 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 2y ago
Exploit prediction
1.06% chance of exploitation in the next 30 days, higher than 65% of all scored CVEs (FIRST EPSS, 2026-11-11).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L |
| GitHub | 3.1 | 7.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | react-pdf | <7.7.3 >=8.0.0, <8.0.2 |
7.7.3 8.0.2 |
Affected products
- wojtekmaj react-pdf
- pdf.js_viewer_project pdf.js_viewer
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
- Technology feeds
References
-
github.com
/mozilla/pdf.js/pull/18015
web
-
github.com
/mozilla/pdf.js/commit/85e64b5c16c9aaef738f421733c12911a441cec6
web
-
github.com
/wojtekmaj/react-pdf/commit/208f28dd47fe38c33ce4bac4205b2b0a0bb207fe
web
-
github.com
/wojtekmaj/react-pdf/commit/671e6eaa2e373e404040c13cc6b668fe39839cad
web
-
github.com
/wojtekmaj/react-pdf/security/advisories/GHSA-87hq-q4gp-9wr4
web, advisory
-
github.com
/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-34342
advisory
-
github.com
/wojtekmaj/react-pdf
package
Sources
- CVE List CVE-2024-34342
- GitHub Advisory GHSA-87hq-q4gp-9wr4
- NVD CVE-2024-34342
- Maintainer advisory GHSA-87hq-q4gp-9wr4
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
The maintainers of wojtekmaj/react-pdf published their own advisory on GitHub. Reviewed sources take precedence over it.