CVE-2024-34342
Published: 07 May 2024
Summary
CVE-2024-34342 is a high-severity Cross-site Scripting (CWE-79) vulnerability. Its CVSS base score is 7.1 (High).
Operationally, ranked in the top 10.2% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.
Deeper analysis
react-pdf is a library for rendering PDFs inside React applications and depends on PDF.js for document processing. The vulnerability is a cross-site scripting flaw that occurs when a malicious PDF is loaded while the PDF.js isEvalSupported option remains at its default value of true, allowing attacker-controlled JavaScript to execute without restriction inside the origin of the hosting page.
An unauthenticated remote attacker can exploit the issue by supplying a crafted PDF that the victim application renders through react-pdf. Successful exploitation yields arbitrary script execution with confidentiality and integrity impact in the context of the hosting domain, along with limited availability consequences, as reflected in the CVSS 7.1 rating.
The referenced GitHub advisories and commits for both pdf.js and react-pdf indicate that the issue is resolved by upgrading react-pdf to version 7.7.3 or 8.0.2; the corresponding pdf.js changes disable unrestricted eval support by default when PDFs are processed. The EPSS score has remained essentially flat near 0.05 with no material post-disclosure rise.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2024-1513
Vulnerability details
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…
more
hosting domain. This vulnerability is fixed in 7.7.3 and 8.0.2.
- CWE(s)
Related Threats
No named actor attribution yet. ATT&CK technique mapping in progress for this CVE.
Affected Assets
Mitigating Controls
Likely Mitigating Controls AI
Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.
Penetration testing submits XSS payloads to web applications, detecting cross-site scripting flaws for subsequent remediation.
Validates web inputs to reject script-related content that could produce XSS.
Output validation against expected content can reject or sanitize script content in generated web pages, reducing XSS exploitability.