Vulnerabilities in pkg:pypi/gradio_pdf
PACKAGEGHSA-4m3g-6r7g-jv4f is a LOW (CVSS 3.6) arbitrary javascript execution due to vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Gradio pdf libraries in the PyPI ecosystem. The issue involves arbitrary javascript execution due to using outdated libraries. Remediation is available by upgrading affected packages to version 0.0.10.
pkg:pypi/gradio_pdf
Vulnerability advisories affecting package pkg:pypi/gradio_pdf. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-4m3g-6r7g-jv4f | - | LOW | Arbitrary JavaScript execution due to using outdated libraries |
GHSA-4m3g-6r7g-jv4f at a Glance
Security Impact
CVSS: 3.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N).
How to Fix GHSA-4m3g-6r7g-jv4f
To remediate this vulnerability, upgrade all affected Gradio pdf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install gradio_pdf>=0.0.10
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show gradio_pdf
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-4m3g-6r7g-jv4f, inspect your installed packages using pip:
pip show gradio_pdf
Analyze the terminal output to locate any version of Gradio pdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.10), your application is affected.
Note: The pip show gradio_pdf command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Gradio pdf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-4m3g-6r7g-jv4f Affected Gradio pdf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gradio_pdf
|
PyPI |
< 0.0.10
|
0.0.10
|
References
Frequently Asked Questions
What is GHSA-4m3g-6r7g-jv4f?
Which Gradio pdf versions are affected?
What version fixes GHSA-4m3g-6r7g-jv4f?
Is gradio_pdf affected?
What is the CVSS score of GHSA-4m3g-6r7g-jv4f?
What CWE is associated with GHSA-4m3g-6r7g-jv4f?
How can I check PyPI dependencies for GHSA-4m3g-6r7g-jv4f?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4m3g-6r7g-jv4f",
"modified" : "2024-06-05T14:15:50Z",
"published" : "2024-06-05T14:15:50Z",
"aliases" : [ ],
"summary" : "Arbitrary JavaScript execution due to using outdated libraries",
"details" : "### Summary\ngradio-pdf projects with dependencies on the pdf.js library are vulnerable to CVE-2024-4367, which allows arbitrary JavaScript execution.\n\n### PoC\n1. Generate a pdf file with a malicious script in the fontmatrix. (This will run `alert(‘XSS’)`.)\n[poc.pdf](https://github.com/user-attachments/files/15516798/poc.pdf)\n\n2. Run the app. In this PoC, I've used the demo for a simple proof.\n\n\n3. Upload a PDF file containing the script.\n\n\n4. Check that the script is running.\n\n\n\n### Impact\nMalicious 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.\n\n### Mitigation\nUpgrade the pdf.js to v4.2.67, which removes the vulnerability. (or set the option `isEvalSupported` to `false`.)\n\n### Reference\n1. https://codeanlabs.com/blog/research/cve-2024-4367-arbitrary-js-execution-in-pdf-js/\n2. https://github.com/mozilla/pdf.js/pull/18015",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "gradio_pdf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.10"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/freddyaboulton/gradio-pdf/security/advisories/GHSA-4m3g-6r7g-jv4f"
}, {
"type" : "WEB",
"url" : "https://github.com/freddyaboulton/gradio-pdf/commit/67edd0c625fae7b855186727ee9678297602ee45"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/freddyaboulton/gradio-pdf"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-05T14:15:50Z",
"nvd_published_at" : null
}
}