Direct flow: os.environ.get (credential/environment) → subprocess.run (code execution)
- Category
- Data Flow
- Confidence
- 97% confidence
- Finding
There is a direct trust-boundary violation from environment-controlled input to process execution: PIKPAK_BIN determines which executable is launched. In an agent or automation context where environment variables may be influenced by a caller, wrapper, or compromised runtime, this enables arbitrary command execution and credential theft via a trojan replacement binary.
- Content
python def pikpak_json(*args, timeout=120): try: proc = subprocess.run([os.environ.get("PIKPAK_BIN", "pikpak"), *args, "-F", "json"], capture_output=True, text=True, timeout=timeout) except (OSError, subprocess.TimeoutExpired): return None, safe_failure(kind="transport")
