Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS04N2hxLXE0Z3AtOXdyNM4AA70i

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

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

Permalink: https://github.com/advisories/GHSA-87hq-q4gp-9wr4
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS04N2hxLXE0Z3AtOXdyNM4AA70i
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 7 months ago
Updated: 7 months ago


CVSS Score: 7.1
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L

Identifiers: GHSA-87hq-q4gp-9wr4, CVE-2024-34342
References: Repository: https://github.com/mozilla/pdf.js
Blast Radius: 27.6

Affected Packages

npm:react-pdf
Dependent packages: 526
Dependent repositories: 7,693
Downloads: 4,601,419 last month
Affected Version Ranges: >= 8.0.0, < 8.0.2, < 7.7.3
Fixed in: 8.0.2, 7.7.3
All affected versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 1.6.0, 1.6.1, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 2.0.0, 2.1.0, 2.1.1, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.2.0, 2.3.0, 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 4.0.0, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.1.0, 4.2.0, 5.0.0, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.2, 5.4.0, 5.4.1, 5.5.0, 5.6.0, 5.7.0, 5.7.1, 5.7.2, 6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.1.0, 6.1.1, 6.2.0, 6.2.1, 6.2.2, 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.1.0, 7.1.1, 7.1.2, 7.1.3, 7.2.0, 7.3.0, 7.3.1, 7.3.2, 7.3.3, 7.4.0, 7.5.0, 7.5.1, 7.6.0, 7.7.0, 7.7.1, 7.7.2, 8.0.0, 8.0.1
All unaffected versions: 7.7.3, 8.0.2, 9.0.0, 9.1.0, 9.1.1