GHSA-vp22-38m5-r39r
### Summary The plugin security validator in PySpector uses AST-based static analysis to prevent dangerous code from being loaded as plugins. The blocklist implemented in `PluginSecurity.validate_plugin_code` is incomplete and can be bypassed using several Python constructs that are not checked. An attacker who can supply a plugin file can achieve arbitrary code execution within the PySpector process when that plugin is installed and executed. ### Details The validator maintains a set called `fatal_calls` that enumerates explicitly forbidden function names and attribute access patterns such as eval, exec, `os.system`, and `subprocess.Popen`. However, this approach relies on an exhaustive blocklist of known-dangerous identifiers, which is inherently incomplete. The following bypass techniques are not detected by the current implementation: `importlib.import_module` is not in `fatal_calls` and is not treated as a dangerous module, so it can be used to load os, subprocess, or any other module at runtime without triggering the validator. Dynamic attribute chains using `__class__.__mro__` and related dunder attributes allow traversal of the class hierarchy to reach arbitrary built-in functions without naming them directly in the source. ctypes is not blocked and can be used to call native library functions including system. `__builtins__` dictionary access exposes all built-in callables without using the names that the validator checks. `types.CodeType` allows construction and execution of raw code objects. The alias resolution in the AST visitor only handles simple import X as Y cases, so aliased imports of blocked modules evade detection, and transitive imports through unblocked modules are never examined. Because the validator produces a pass/fail result that gates plugin installation with the --trust flag, a bypass causes untrusted plugin code to execute with the full privileges of the PySpector process. ### PoC ```python import textwrap, tempfile, os e
Properties
- ghsa_id
- GHSA-vp22-38m5-r39r
- severity
- medium
- summary
- PySpector has a Plugin Code Execution Bypass via Incomplete Static Analysis in PluginSecurity.validate_plugin_code
- cve_id
- GHSA-vp22-38m5-r39r
- is_ghsa_only
- true
- ghsa_published
- 2026-04-16T01:09:17Z
- source_url
- https://github.com/advisories/GHSA-vp22-38m5-r39r
- ghsa_updated
- 2026-04-16T01:09:20Z
Related Entities (4)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
VULNERABLE_TO (1)
Explore deeper with Ninja Signal's threat intelligence graph