{"id":"CVE-2024-34342","aliases":["CVE-2024-34342","GHSA-87hq-q4gp-9wr4"],"related":[],"kind":"vulnerability","state":"published","title":"react-pdf's PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nIf 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.\n\n### Patches\n[This patch](https://github.com/wojtekmaj/react-pdf/commit/671e6eaa2e373e404040c13cc6b668fe39839cad) forces `isEvalSupported` to `false`, removing the attack vector.\n\n### Workarounds\nSet `options.isEvalSupported` to `false`, where `options` is `Document` component prop.\n\n### References\n- [GHSA-wgrm-67xf-hhpq](https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq)\n- https://github.com/mozilla/pdf.js/pull/18015\n- https://github.com/mozilla/pdf.js/commit/85e64b5c16c9aaef738f421733c12911a441cec6\n- https://bugzilla.mozilla.org/show_bug.cgi?id=1893645","format":"markdown","source":"ghsa"},{"lang":"es","text":"react-pdf muestra archivos PDF en aplicaciones React. Si se utiliza PDF.js para cargar un PDF malicioso y PDF.js está configurado con `isEvalSupported` establecido en `true` (que es el valor predeterminado), se ejecutará JavaScript sin restricciones controlado por el atacante en el contexto del dominio de alojamiento. Esta vulnerabilidad se solucionó en 7.7.3 y 8.0.2.","source":"nvd"}],"published":"2024-05-07T14:29:06.599Z","modified":"2026-06-17T07:33:12.770Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L","score":7.1,"rating":"HIGH"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 7.7.3","status":"affected"},{"version":">= 8.0.0, < 8.0.2","status":"affected"}],"vendor":"wojtekmaj","product":"react-pdf","source":"cvelist"},{"ranges":[{"version":"< 7.7.3, \t>= 8.0.0, < 8.0.2","status":"affected"}],"vendor":"pdf.js_viewer_project","product":"pdf.js_viewer","cpe":"cpe:2.3:a:pdf.js_viewer_project:pdf.js_viewer:*:*:*:*:*:wordpress:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"7.7.3"}],"ecosystem":"npm","package":"react-pdf","purl":"pkg:npm/react-pdf","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"8.0.0","status":"affected","fixed":"8.0.2"}],"ecosystem":"npm","package":"react-pdf","purl":"pkg:npm/react-pdf","source":"ghsa"}],"references":[{"url":"https://github.com/wojtekmaj/react-pdf/security/advisories/GHSA-87hq-q4gp-9wr4","tags":["web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mozilla/pdf.js/pull/18015","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mozilla/pdf.js/commit/85e64b5c16c9aaef738f421733c12911a441cec6","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/wojtekmaj/react-pdf/commit/208f28dd47fe38c33ce4bac4205b2b0a0bb207fe","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/wojtekmaj/react-pdf/commit/671e6eaa2e373e404040c13cc6b668fe39839cad","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34342","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/wojtekmaj/react-pdf","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2024-05-07T18:55:02.356Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-34342","url":"https://www.cve.org/CVERecord?id=CVE-2024-34342","licence":"CVE Terms of Use","modified":"2024-08-02T02:51:10.948Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-87hq-q4gp-9wr4","url":"https://github.com/advisories/GHSA-87hq-q4gp-9wr4","licence":"CC-BY-4.0","modified":"2026-02-04T02:26:44.613Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-34342","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34342","licence":"Public domain","modified":"2026-06-17T07:33:12.770Z"}],"updatedAt":"2026-11-25T22:58:40.040Z","epss":{"score":0.01064,"percentile":0.65638,"date":"2026-12-02T12:00:21.000Z"}}