{"id":"CVE-2026-33140","aliases":["EUVD-2026-13776","GHSA-2gmv-2r3v-jxj2","PYSEC-2026-3029"],"status":"published","title":"PySpector: Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution","description":"PySpector is a static analysis security testing (SAST) Framework engineered for modern Python development workflows. PySpector versions 0.1.6 and prior 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. This issue has been patched in version 0.1.7.","severity":{"version":"4.0","score":5.3,"vector":"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","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00231,"percentile":0.13991,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2026-03-18T16:33:46Z","modified":"2026-07-13T16:43:19Z","fixes":[{"ecosystem":"PyPI","package":"pyspector","fixed_in":["0.1.7"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"pyspector","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.1.6"},{"fixed":"0.1.7"}]}]},{"source":"osv","ecosystem":"PyPI","package":"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"]},{"source":"osv","ecosystem":"PyPI","package":"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"]}],"products":[{"vendor":"parzivalhack","product":"pyspector"}],"references":[{"url":"https://github.com/ParzivalHack/PySpector/security/advisories/GHSA-2gmv-2r3v-jxj2","tags":["x_refsource_CONFIRM","Exploit","Vendor Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33140","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-2gmv-2r3v-jxj2","tags":["advisory"]},{"url":"https://github.com/ParzivalHack/PySpector","tags":["package"]},{"url":"https://pypi.org/project/pyspector","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-33140","title":"PySpector: Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution","description":"PySpector is a static analysis security testing (SAST) Framework engineered for modern Python development workflows. PySpector versions 0.1.6 and prior 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. This issue has been patched in version 0.1.7.","status":"published","published":"2026-03-20T20:00:20.929Z","modified":"2026-03-24T18:55:00.491Z","cvss":[{"version":"4.0","score":5.3,"vector":"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","level":"medium","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:20:07.609948Z"}],"euvd":[{"id":"EUVD-2026-13776","description":"PySpector is a static analysis security testing (SAST) Framework engineered for modern Python development workflows. PySpector versions 0.1.6 and prior 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. This issue has been patched in version 0.1.7.","status":"published","published":"2026-03-20T20:00:20Z","modified":"2026-03-24T18:55:00Z","cvss":[{"version":"4.0","score":5.3,"vector":"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","level":"medium"}],"updated_at":"2026-11-02T19:25:29.547775Z"}],"ghsa":[{"id":"GHSA-2gmv-2r3v-jxj2","title":"Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution","description":"### Summary\nPySpector versions `\u003c= 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 `\u003c= 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\u003cimg width=\"871\" height=\"752\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1b0a57f2-3632-4347-a9b7-6a94dc2e82b2\" /\u003e\n2. Open the generated HTML report in any browser:\n\u003cimg width=\"1920\" height=\"920\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a4075c4a-6153-41b4-ad77-81d009d7a9f8\" /\u003e","status":"published","published":"2026-03-18T16:33:46Z","modified":"2026-03-20T21:33:19Z","cvss":[{"version":"4.0","score":5.3,"vector":"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","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:39:40.633038Z"}],"nvd":[{"id":"CVE-2026-33140","description":"PySpector is a static analysis security testing (SAST) Framework engineered for modern Python development workflows. PySpector versions 0.1.6 and prior 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. This issue has been patched in version 0.1.7.","status":"published","published":"2026-03-20T20:16:49.077Z","modified":"2026-06-17T10:37:00.897Z","cvss":[{"version":"4.0","score":5.3,"vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:12:10.126802Z"}],"osv":[{"id":"GHSA-2gmv-2r3v-jxj2","title":"Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution","description":"### Summary\nPySpector versions `\u003c= 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 `\u003c= 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\u003cimg width=\"871\" height=\"752\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1b0a57f2-3632-4347-a9b7-6a94dc2e82b2\" /\u003e\n2. Open the generated HTML report in any browser:\n\u003cimg width=\"1920\" height=\"920\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a4075c4a-6153-41b4-ad77-81d009d7a9f8\" /\u003e","status":"published","published":"2026-03-18T16:33:46Z","modified":"2026-07-13T16:43:19.639829472Z","cvss":[{"version":"4.0","score":5.3,"vector":"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","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:34.338541Z"},{"id":"PYSEC-2026-3029","title":"Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution","description":"### Summary\nPySpector versions `\u003c= 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 `\u003c= 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\u003cimg width=\"871\" height=\"752\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1b0a57f2-3632-4347-a9b7-6a94dc2e82b2\" /\u003e\n2. Open the generated HTML report in any browser:\n\u003cimg width=\"1920\" height=\"920\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a4075c4a-6153-41b4-ad77-81d009d7a9f8\" /\u003e","status":"published","published":"2026-07-13T14:36:43.604457Z","modified":"2026-07-13T16:33:10.065061284Z","cvss":[{"version":"4.0","score":5.3,"vector":"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","level":"medium"}],"updated_at":"2026-11-02T15:52:56.429374Z"}]}}
