PYSEC-2026-3029

Vulnerability from pysec - Published: 2026-07-13 14:36 - Updated: 2026-07-13 16:06
VLAI
Details

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

Impacted products
Name purl
pyspector pkg:pypi/pyspector

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "pyspector",
        "purl": "pkg:pypi/pyspector"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.1.7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "0.1.1",
        "0.1.2",
        "0.1.3",
        "0.1.4",
        "0.1.4.post1",
        "0.1.5",
        "0.1.6"
      ]
    }
  ],
  "aliases": [
    "CVE-2026-33140",
    "GHSA-2gmv-2r3v-jxj2"
  ],
  "details": "### 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\u0027s 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\u0027s 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",
  "id": "PYSEC-2026-3029",
  "modified": "2026-07-13T16:06:03.781524Z",
  "published": "2026-07-13T14:36:43.604457Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/ParzivalHack/PySpector/security/advisories/GHSA-2gmv-2r3v-jxj2"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-33140"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/ParzivalHack/PySpector"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/pyspector"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-2gmv-2r3v-jxj2"
    }
  ],
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Stored XSS in PySpector HTML Report Generation leads to Javascript Code Execution"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…