Summary
PySpector versions <= 0.1.6 are affected by a security validation bypass in the plugin system. The validate_plugin_code() function in plugin_system.py, performs static AST analysis to block dangerous API calls before a plugin is trusted and executed. However, the internal resolve_name() helper only handles ast.Name and ast.Attribute node types, returning None for all others. When a plugin uses indirect function calls via getattr() (such as getattr(os, 'system')) the outer call's func node is of type ast.Call, causing resolve_name() to return None, and the security check to be silently skipped. The plugin incorrectly passes the trust workflow, and executes arbitrary system commands on the user's machine when loaded.
Impact
An attacker who can deliver a malicious plugin file to a PySpector user and convince them to install it, can achieve arbitrary code execution on the user's local machine. Exploitation requires the victim to explicitly run pyspector plugin install --trust on the malicious file (a deliberate multi-step action that meaningfully limits the attack surface compared to passive vulnerabilities). However, the bypass directly undermines the security guarantee that validate_plugin_code() is designed to provide. Once the plugin is trusted and executed, the following is achievable:
- Full read/write access to the local filesystem
- Exfiltration of sensitive data and environment variables (i.e. API keys, credentials, etc...)
- Establishment of persistence mechanisms
- Lateral movement in CI/CD environments where PySpector runs with elevated permissions (pre-commit hooks and scheduled scans)
Any user of PySpector who installs third-party plugins outside the official repository is potentially affected.
PoC
The following steps reproduce the vulnerability on PySpector <= 0.1.6:
- Create a malicious plugin file that uses getattr-based indirect calls to bypass AST validation, and confirm the validator incorrectly marks it as safe:

2. Run PySpector Plugin Validator module (this confirms the validator incorrectly marks the plugin as safe):

3. Install and trust the plugin through the normal PySpector workflow:
pyspector plugin install /tmp/evil_plugin.py --trust
4. Execute the plugin, during a scan:
pyspector scan /any/target --plugin evil
References
Summary
PySpector versions
<= 0.1.6are affected by a security validation bypass in the plugin system. Thevalidate_plugin_code()function inplugin_system.py, performs static AST analysis to block dangerous API calls before a plugin is trusted and executed. However, theinternal resolve_name()helper only handlesast.Nameandast.Attributenode types, returningNonefor all others. When a plugin uses indirect function calls viagetattr()(such asgetattr(os, 'system')) the outer call's func node is of typeast.Call, causingresolve_name()to returnNone, and the security check to be silently skipped. The plugin incorrectly passes the trust workflow, and executes arbitrary system commands on the user's machine when loaded.Impact
An attacker who can deliver a malicious plugin file to a PySpector user and convince them to install it, can achieve arbitrary code execution on the user's local machine. Exploitation requires the victim to explicitly run
pyspector plugin install --truston the malicious file (a deliberate multi-step action that meaningfully limits the attack surface compared to passive vulnerabilities). However, the bypass directly undermines the security guarantee thatvalidate_plugin_code()is designed to provide. Once the plugin is trusted and executed, the following is achievable:Any user of PySpector who installs third-party plugins outside the official repository is potentially affected.
PoC
The following steps reproduce the vulnerability on PySpector
<= 0.1.6:
2. Run PySpector Plugin Validator module (this confirms the validator incorrectly marks the plugin as safe):
3. Install and trust the plugin through the normal PySpector workflow:pyspector plugin install /tmp/evil_plugin.py --trust4. Execute the plugin, during a scan:
pyspector scan /any/target --plugin evilReferences