All reports
High

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

Affected versions

Affected versions
>= 8.0.0, < 8.0.2
Fixed version
8.0.2
Affected versions
< 7.7.3
Fixed version
7.7.3

Exploitation

CVE-2024-34342

Probability of exploitation in the next 30 days: 1.06%

FIRST EPSS · 2026-11-21

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

Links

Credits

  • calixteman
  • ThomasRinsma
  • wojtekmaj