Cross-Site Scripting (XSS) in pyspector (CVE-2026-33140)
Summary
Cross-site scripting in pyspector (CVE-2026-33140). Risk of unauthorized operations or information disclosure. Exploitable via XMLHttpRequest. Mitigation: upgrade to 0.1.7 or later.
Original description
The description as published by the source.
Summary
PySpector 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.
Impact
An 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:
- Arbitrary DOM manipulation
- Redirects to attacker-controlled pages
- Theft of locally accessible data via
fetch()orXMLHttpRequesttofile://paths (browser-dependent)
Any user of PySpector who scans untrusted code and generates HTML reports, is potentially affected.
PoC
The following steps reproduce the vulnerability on PySpector <= 0.1.6:
-
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: -
Open the generated HTML report in any browser:
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-33140 has been found in pyspector.
Attackers can target a specific entry point like XMLHttpRequest over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade pyspector to 0.1.7 or later.
If unsure, ask your IT team or search "pyspector CVE-2026-33140" on the vendor's site.
CVE-2026-33140 (pyspector) — CWE-79
Attack surface: XMLHttpRequest
Patched: 0.1.7 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Cross-site scripting (XSS) (CWE-79) exists in pyspector. Attackers reach the vulnerable code path via XMLHttpRequest.
Check the vendor advisory for the affected versions of pyspector. Attack surface: XMLHttpRequest.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 0.1.7.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'pyspector' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'pyspector' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
pyspectorを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade pyspector to 0.1.7ステージング環境で 0.1.7 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com