Tool Parameter Abuse
- Category
- Tool Misuse
- Confidence
- 90% confidence
- Finding
This is the same execution boundary identified by AST4, not an independent exploit: task-controlled cmd, cwd, and timeout values flow into subprocess execution without policy enforcement. If a lower-trust contributor or agent-generated artifact controls the suite, its contents become shell instructions with the runner's authority; merely being JSON does not make the suite safe to execute.
- Content
python cmd, expect_contains?, timeout?} Results: state/evals/last-run.json (+ a trace row when TRACE_DB is available). """ import argparse import json import os import subprocess import sys import time from datetime import datetime, timezone sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) def run_task(t): t0 = time.time() if t["kind"] == "file_exists": p = os.path.expanduser(t["path"]) ok = os.path.exists(p) out = p if ok else "missing: " + p else: p = subprocess.run(t["cmd"], shell=True, text=True, capture_output=True, timeout=t.get("timeout", 20), cwd=t.get("cwd")) out = (p.stdout or "") + (p.stderr or "") ok = p.returncode == 0 if ok and t.get("expect_contains"): ok = t["expect_contains"] in out if ok and t.get("expect_not_contains"): ok = t["expect_not_contains"] not in out return ok, out.strip()[:400], int((time.time() - t0) * 1000) def main(): ap = argparse.
