CVE-2026-33140 PySpector: Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution
Attackers can execute arbitrary JavaScript in a developer's browser by crafting Python files that trigger unsanitized output in PySpector HTML reports.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-33140?
CVE-2026-33140 is a medium-severity cross-site scripting vulnerability in ParzivalHack PySpector, published on 20 Mar 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-79
Which versions are affected by CVE-2026-33140?
3 open source packages ship an affected version, including pyspector. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pyspector PyPI | All versions | 0.1.7 |
pyspector PyPI | All versions | 0.1.7 |
pyspector PyPI | All versions | 0.1.7 |
Products include Parzivalhack Pyspector.
How do I fix CVE-2026-33140?
Upgrade pyspector to 0.1.7 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-33140 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33140 exists.
Other vulnerabilities in ParzivalHack PySpector
Sources
Also known as GHSA-2gmv-2r3v-jxj2, PYSEC-2026-3029.