Files
vuln-osv/data/PyPI/GHSA-2gmv-2r3v-jxj2.json

1 line
3.0 KiB
JSON

{"schema_version":"1.9.0","id":"GHSA-2gmv-2r3v-jxj2","published":"2026-03-18T16:33:46Z","modified":"2026-07-13T16:43:19.639829472Z","aliases":["CVE-2026-33140","PYSEC-2026-3029"],"summary":"Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution","details":"### Summary\nPySpector versions `<= 0.1.6` are affected by a stored Cross-Site Scripting (XSS) vulnerability in the HTML report generator. When PySpector scans a Python file containing JavaScript payloads (i.e. inside a string passed to `eval()` ), the flagged code snippet is interpolated into the HTML report without sanitization. Opening the generated report in a browser causes the embedded JavaScript to execute in the browser's local file context.\n\n### Impact\nAn attacker can craft a malicious Python file (for example, hosted in a public repository), designed to be scanned by PySpector. When a victim scans this file and opens the resulting HTML report, arbitrary JavaScript executes in their browser. While the `file://` context limits the attacker's ability to exfiltrate cookies or make credentialed requests, the following is still achievable:\n- Arbitrary DOM manipulation\n- Redirects to attacker-controlled pages\n- Theft of locally accessible data via `fetch()` or `XMLHttpRequest` to `file://` paths (browser-dependent)\n\nAny user of PySpector who scans untrusted code and generates HTML reports, is potentially affected.\n\n### PoC\n\nThe following steps reproduce the vulnerability on PySpector `<= 0.1.6`:\n1. Create a malicious Python file containing a JavaScript payload embedded in a string argument to `eval()`, and run PySpector against the file, generating an HTML report:\n<img width=\"871\" height=\"752\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1b0a57f2-3632-4347-a9b7-6a94dc2e82b2\" />\n2. Open the generated HTML report in any browser:\n<img width=\"1920\" height=\"920\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a4075c4a-6153-41b4-ad77-81d009d7a9f8\" />","affected":[{"package":{"name":"pyspector","ecosystem":"PyPI","purl":"pkg:pypi/pyspector"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.7"}]}],"versions":["0.1.1","0.1.2","0.1.3","0.1.4","0.1.4.post1","0.1.5","0.1.6"],"database_specific":{"last_known_affected_version_range":"<= 0.1.6","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-2gmv-2r3v-jxj2/GHSA-2gmv-2r3v-jxj2.json"}}],"references":[{"type":"WEB","url":"https://github.com/ParzivalHack/PySpector/security/advisories/GHSA-2gmv-2r3v-jxj2"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33140"},{"type":"PACKAGE","url":"https://github.com/ParzivalHack/PySpector"}],"database_specific":{"cwe_ids":["CWE-79"],"github_reviewed":true,"github_reviewed_at":"2026-03-18T16:33:46Z","nvd_published_at":"2026-03-20T20:16:49Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"}]}