{"id":"CVE-2026-33139","aliases":["CVE-2026-33139","GHSA-v3xv-8vc3-h2m6","PYSEC-2026-3030"],"related":[],"kind":"vulnerability","state":"published","title":"PySpector: Plugin Sandbox Bypass leads to Arbitrary Code Execution","summary":"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 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. This issue has been patched in version 0.1.7.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 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. This issue has been patched in version 0.1.7.","source":"cvelist"},{"lang":"en","text":"### Summary\nPySpector 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.\n\n### Impact\nAn 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:\n- Full read/write access to the local filesystem\n- Exfiltration of sensitive data and environment variables (i.e. API keys, credentials, etc...)\n- Establishment of persistence mechanisms\n- Lateral movement in CI/CD environments where PySpector runs with elevated permissions (pre-commit hooks and scheduled scans)\n\nAny user of PySpector who installs third-party plugins outside the official repository is potentially affected.\n\n### PoC\nThe following steps reproduce the vulnerability on PySpector `<= 0.1.6`:\n1. Create a malicious plugin file that uses getattr-based indirect calls to bypass AST validation, and confirm the validator incorrectly marks it as safe:\n<img width=\"1300\" height=\"675\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4de3a0d1-1c77-4454-ad10-2369d5ca9997\" />\n2.  Run PySpector Plugin Validator module (this confirms the validator incorrectly marks the plugin as safe):\n<img width=\"908\" height=\"239\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3e3b9603-4d95-4a39-be97-4163f6639599\" />\n3. Install and trust the plugin through the normal PySpector workflow:\n\n`pyspector plugin install /tmp/evil_plugin.py --trust`\n4. Execute the plugin, during a scan:\n`pyspector scan /any/target --plugin evil`","format":"markdown","source":"ghsa"},{"lang":"es","text":"PySpector es un framework de pruebas de seguridad de análisis estático (SAST) diseñado para flujos de trabajo de desarrollo de Python modernos. Las versiones 0.1.6 y anteriores de PySpector están afectadas por una omisión de validación de seguridad en el sistema de plugins. La función validate_plugin_code() en plugin_system.py, realiza un análisis AST estático para bloquear llamadas peligrosas a la API antes de que un plugin sea confiable y ejecutado. Sin embargo, la función auxiliar interna resolve_name() solo maneja los tipos de nodo ast.Name y ast.Attribute, devolviendo None para todos los demás. Cuando un plugin utiliza llamadas a funciones indirectas a través de getattr() (como getattr(os, 'system')) el nodo func de la llamada externa es de tipo ast.Call, lo que provoca que resolve_name() devuelva None, y que la comprobación de seguridad se omita silenciosamente. El plugin pasa incorrectamente el flujo de trabajo de confianza y ejecuta comandos de sistema arbitrarios en la máquina del usuario cuando se carga. Este problema ha sido parcheado en la versión 0.1.7.","source":"nvd"}],"published":"2026-03-18T16:33:34.000Z","modified":"2026-07-13T16:43:01.825Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"}],"cwes":["CWE-184"],"affected":[{"ranges":[{"version":"< 0.1.7","status":"affected"}],"vendor":"ParzivalHack","product":"PySpector","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.7"}],"ecosystem":"PyPI","package":"pyspector","purl":"pkg:pypi/pyspector","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.1.7"}],"vendor":"parzivalhack","product":"pyspector","cpe":"cpe:2.3:a:parzivalhack:pyspector:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.7"}],"ecosystem":"PyPI","package":"pyspector","purl":"pkg:pypi/pyspector","source":"pysec"}],"references":[{"url":"https://github.com/ParzivalHack/PySpector/security/advisories/GHSA-v3xv-8vc3-h2m6","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33139","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/ParzivalHack/PySpector","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pyspector","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-v3xv-8vc3-h2m6","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-20T20:14:08.844Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33139","url":"https://www.cve.org/CVERecord?id=CVE-2026-33139","licence":"CVE Terms of Use","modified":"2026-03-20T20:14:19.228Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v3xv-8vc3-h2m6","url":"https://github.com/advisories/GHSA-v3xv-8vc3-h2m6","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:01.825Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33139","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33139","licence":"Public domain","modified":"2026-06-17T10:37:00.780Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3030","url":"https://osv.dev/vulnerability/PYSEC-2026-3030","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:12.248Z"}],"updatedAt":"2026-11-25T22:59:16.335Z","epss":{"score":0.00198,"percentile":0.10127,"date":"2026-12-01T12:00:22.000Z"}}