Direct flow: os.environ.get (credential/environment) → subprocess.run (code execution)
- Category
- Data Flow
- Confidence
- 89% confidence
- Finding
The script executes whatever binary path is supplied via PIKPAK_BIN, and if that is unset it relies on PATH resolution for 'pikpak'. In untrusted CI, multi-user systems, or any environment where callers can influence environment variables or PATH, an attacker can cause arbitrary code execution by pointing to a malicious executable.
- Content
python def pikpak(*args: str, timeout: int = 3600): try: proc = subprocess.run([os.environ.get("PIKPAK_BIN", "pikpak"), *args], capture_output=True, text=True, timeout=timeout) if proc.returncode: return proc.returncode, "", f"cli_failed (exit_code={proc.returncode})"
