Advisory

GHSA-4m3g-6r7g-jv4f

Also known as: None

Summary

Arbitrary JavaScript execution due to using outdated libraries

Details

Summary
gradio-pdf projects with dependencies on the pdf.js library are vulnerable to CVE-2024-4367, which allows arbitrary JavaScript execution.

PoC

  1. Generate a pdf file with a malicious script in the fontmatrix. (This will run alert(‘XSS’).)

poc.pdf

  1. Run the app. In this PoC, I've used the demo for a simple proof.

1

  1. Upload a PDF file containing the script.

2

  1. Check that the script is running.

3

Impact
Malicious scripts can be injected into the code, and when linked with vulnerabilities such as CSRF, it can cause even greater damage. In particular, It can become a source of further attacks, especially when linked to social engineering.

Mitigation
Upgrade the pdf.js to v4.2.67, which removes the vulnerability. (or set the option isEvalSupported to false.)

Reference

  1. https://codeanlabs.com/blog/research/cve-2024-4367-arbitrary-js-execution-in-pdf-js/
  2. https://github.com/mozilla/pdf.js/pull/18015

Severity

Low Basis: The source's own band: LOW

Dates

Published
2024-06-05 14:15 UTC
Modified
2024-12-02 05:49 UTC

Affected packages and fixes

gradio-pdf

PyPI · All systems

Affected

  • introduced 0, fixed 0.0.10 (ecosystem)

Fixed versions

0.0.10

Fix

  • Fixed version 0.0.10
    pip install --upgrade gradio-pdf==0.0.10

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences