Tainted flow: 'bastion_path' from os.environ.get (line 158, credential/environment) → subprocess.run (code execution)
Medium
- Category
- Data Flow
- Content
if bastion_path.exists(): # bastion uses subparser: --workspace before scan try: result = subprocess.run( [sys.executable, str(bastion_path), "--workspace", str(workspace), "scan", "--json"], capture_output=True, text=True,- Confidence
- 75% confidence
- Finding
- bastion_path is derived from SCANNERS_DIR, an environment-controlled path, and is executed as Python code after only an existence check. In CI, if an attacker can influence action inputs/environment or repository contents that populate the scanners directory, they can cause execution of a malicious scanner script and achieve arbitrary code execution in the runner context.
