{"id":"CVE-2026-33140","aliases":["CVE-2026-33140","GHSA-2gmv-2r3v-jxj2","PYSEC-2026-3029"],"related":[],"kind":"vulnerability","state":"published","title":"PySpector: Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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\" />","format":"markdown","source":"ghsa"},{"lang":"es","text":"PySpector es un Framework de pruebas de seguridad de análisis estático (SAST) diseñado para flujos de trabajo de desarrollo de Python modernos. Las versiones 0.1.6 y anteriores de PySpector están afectadas por una vulnerabilidad de Cross-Site Scripting (XSS) almacenado en el generador de informes HTML. Cuando PySpector escanea un archivo Python que contiene cargas útiles de JavaScript (es decir, dentro de una cadena pasada a eval() ), el fragmento de código marcado se intercala en el informe HTML sin sanitización. Abrir el informe generado en un navegador hace que el JavaScript incrustado se ejecute en el contexto de archivo local del navegador. Este problema ha sido parcheado en la versión 0.1.7.","source":"nvd"}],"published":"2026-03-18T16:33:46.000Z","modified":"2026-07-13T16:43:19.639Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","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"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 0.1.7","status":"affected"}],"vendor":"ParzivalHack","product":"PySpector","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.7"}],"ecosystem":"PyPI","package":"pyspector","purl":"pkg:pypi/pyspector","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.1.7"}],"vendor":"parzivalhack","product":"pyspector","cpe":"cpe:2.3:a:parzivalhack:pyspector:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.7"}],"ecosystem":"PyPI","package":"pyspector","purl":"pkg:pypi/pyspector","source":"pysec"}],"references":[{"url":"https://github.com/ParzivalHack/PySpector/security/advisories/GHSA-2gmv-2r3v-jxj2","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33140","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/ParzivalHack/PySpector","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pyspector","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-2gmv-2r3v-jxj2","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-03-24T18:54:51.778Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33140","url":"https://www.cve.org/CVERecord?id=CVE-2026-33140","licence":"CVE Terms of Use","modified":"2026-03-24T18:55:00.491Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2gmv-2r3v-jxj2","url":"https://github.com/advisories/GHSA-2gmv-2r3v-jxj2","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:19.639Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33140","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33140","licence":"Public domain","modified":"2026-06-17T10:37:00.897Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3029","url":"https://osv.dev/vulnerability/PYSEC-2026-3029","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:10.065Z"}],"updatedAt":"2026-11-25T22:59:16.337Z","epss":{"score":0.00311,"percentile":0.16439,"date":"2026-11-30T12:00:22.000Z"}}