Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-2gmv-2r3v-jxj2

Опубликовано: 18 мар. 2026
Источник: github
Github: Прошло ревью
CVSS4: 5.3

Описание

Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution

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() or XMLHttpRequest to file:// 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:

  1. 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: image
  2. Open the generated HTML report in any browser:
image

Пакеты

Наименование

pyspector

pip
Затронутые версииВерсия исправления

<= 0.1.6

0.1.7

EPSS

Процентиль: 1%
0.0001
Низкий

5.3 Medium

CVSS4

Дефекты

CWE-79

Связанные уязвимости

CVSS3: 6.1
nvd
23 дня назад

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.

EPSS

Процентиль: 1%
0.0001
Низкий

5.3 Medium

CVSS4

Дефекты

CWE-79