subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def get_reauth_url(reauth_script: Path) -> str: result = subprocess.run(["python3", str(reauth_script)], capture_output=True, text=True, timeout=30, check=False) if result.returncode != 0: raise StravaAuthError((result.stderr or result.stdout).strip() or "Failed to generate Strava reauth URL") return result.stdout.strip()- Confidence
- 93% confidence
- Finding
- The code executes a Python script from a path that is user-configurable via --reauth-script, with only an existence check before invocation. In an agent/runtime context, this creates arbitrary local code execution risk if an attacker can influence that path or place a malicious script at the expected workspace location; the skill context makes this more dangerous because agent workspaces often contain untrusted or mutable files.
