subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
ok = os.path.getmtime(c["path"]) > os.path.getmtime(c["ref_path"]) return ok, f"{label}: 产物{'新于' if ok else '不新于'}参照" if t == "script_exit": r = subprocess.run(c["cmd"], shell=True, capture_output=True, text=True, timeout=300) expect = c.get("expect", 0) ok = r.returncode == expect tail = (r.stdout or r.stderr).strip().splitlines()- Confidence
- 99% confidence
- Finding
- The script executes spec-provided commands with subprocess.run(..., shell=True), so anyone who can influence the spec can run arbitrary shell commands in the agent's environment. In this skill's context, specs are expected to be generated dynamically from workflow claims, which makes this especially dangerous because untrusted or prompt-influenced inputs can cross directly into code execution.
