CVE-2026-41206
Python vulnerability analysis and mitigation

Overview

CVE-2026-41206 is a plugin system bypass vulnerability in PySpector, a static analysis security testing (SAST) framework for Python, that allows arbitrary code execution via an incomplete AST-based blocklist. The flaw resides in PluginSecurity.validate_plugin_code, which can be circumvented using standard Python constructs not covered by the blocklist. All versions prior to 0.1.8 are affected. The vulnerability was published on April 23, 2026, with a fix released in version 0.1.8. It carries a CVSS v3.1 score of 7.8 (High) and a CVSS v4.0 score of 6.9 (Medium) (GitHub Advisory).

Technical details

The root cause is classified as CWE-184 (Incomplete List of Disallowed Inputs). PySpector's PluginSecurity.validate_plugin_code method uses an AST-based visitor to check plugin code against a fatal_calls set of explicitly forbidden identifiers (e.g., eval, exec, os.system, subprocess.Popen). This blocklist approach is inherently incomplete: importlib.import_module was not blocked, allowing runtime loading of os or subprocess; dynamic attribute chains using dunder attributes (__class__.__mro__) could traverse the class hierarchy; ctypes was unblocked for native library calls; __builtins__ dictionary access exposed all built-in callables; types.CodeType allowed raw code object construction; and aliased imports of blocked modules evaded detection. Because the validator gates plugin installation with a pass/fail result, a bypass causes untrusted plugin code to execute with full PySpector process privileges. A public PoC using importlib.import_module('os') followed by mod.system('id > /tmp/pwned') demonstrates the bypass (GitHub Advisory).

Impact

Successful exploitation allows an attacker who can supply a malicious plugin file to execute arbitrary operating system commands with the full privileges of the PySpector process. The static analysis check provides a false sense of security, as it can be trivially circumvented using standard library modules present in every Python installation. This results in high confidentiality and integrity impact (full process compromise, potential data exfiltration and unauthorized modification) and low availability impact within the vulnerable system scope (GitHub Advisory).

Exploitability

A public proof-of-concept exploit is available in the GitHub security advisory, demonstrating the bypass using importlib.import_module to load os and execute a shell command. The attack requires local access and user interaction (a user must install and execute the malicious plugin), with no privileges required at the network level. There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is approximately 0.023% (GitHub Advisory).

Exploitation steps

  1. Craft a malicious plugin: Create a Python file that uses importlib.import_module (or another unblocked construct) to load a dangerous module and execute an OS command, e.g.:
import importlib
mod = importlib.import_module('os')
mod.system('id > /tmp/pwned')
  1. Deliver the plugin: Supply the malicious .py file to a target user or system running PySpector versions ≤0.1.7, for example by distributing it as a legitimate-looking plugin package.
  2. Trigger plugin installation: Convince the target to install the plugin using PySpector's plugin installation workflow (e.g., with the --trust flag), which invokes PluginSecurity.validate_plugin_code on the supplied file.
  3. Bypass validation: The validator's fatal_calls blocklist does not include importlib.import_module, so the plugin passes the AST-based security check without triggering any alert.
  4. Achieve code execution: PySpector loads and executes the plugin, running the attacker's OS command with the full privileges of the PySpector process (GitHub Advisory).

Indicators of compromise

  • File System: Unexpected files created by the PySpector process (e.g., /tmp/pwned or similar artifacts); new or unfamiliar .py plugin files in the PySpector plugin directory containing importlib, ctypes, __builtins__, or __class__.__mro__ references.
  • Process: Unusual child processes spawned by the PySpector Python process (e.g., sh, bash, id, curl, wget); unexpected network connections originating from the PySpector process.
  • Logs: PySpector logs showing plugin validation passing for plugins that use importlib.import_module or other non-blocked dynamic constructs; absence of expected rejection messages for suspicious plugin code.

Mitigation and workarounds

Upgrade PySpector to version 0.1.8 or later, which significantly expands the blocklist to include importlib, ctypes, cffi, types, and related constructs, and adopts a fail-closed design principle for the plugin validator. Until patching is possible, restrict plugin installation to trusted, internally reviewed sources only and manually audit any plugin files before installation. Limit which users or processes have permission to install plugins in PySpector deployments (GitHub Advisory, Patch Commit).

Community reactions

The vulnerability was reported by researcher fg0x0 and disclosed via GitHub's security advisory program. The advisory was rated "Moderate" by the maintainer, reflecting the local attack vector and required user interaction. No significant broader media coverage or notable community commentary beyond the advisory itself has been identified.

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66455CRITICAL9.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-63374CRITICAL9.3
  • Python logoPython
  • airflow-3
NoYesSep 18, 2026
CVE-2026-59163CRITICAL9.1
  • Python logoPython
  • mnemosyne-memory
NoYesSep 18, 2026
CVE-2026-33625HIGH8.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-64847MEDIUM6.8
  • Python logoPython
  • py3-anyio
NoYesSep 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management