Unvalidated Output Injection
High
- Category
- Output Handling
- Content
# ── report: dirty fixture → COMPROMISED rc4 (findings are ORDER-DEPENDENT) ─── REPCMD="python3 scripts/benchscan.py report --name selftest-bench --benchmark $SBX/bench.jsonl --corpus $SBX/corp.jsonl --cutoff 2024-06-01 --results $SBX/repro.jsonl --runs $SBX/runs.jsonl --curve $SBX/fewshot.jsonl --judgments $SBX/judgments.jsonl --a-preds $SBX/a.jsonl --b-preds $SBX/b.jsonl" chk "report rc4 COMPROMISED worst>=75 + ledger 0600" "python3 -c 'import json,os,stat,subprocess; r=subprocess.run(\"python3 scripts/benchscan.py report --name selftest-bench --benchmark $SBX/bench.jsonl --corpus $SBX/corp.jsonl --cutoff 2024-06-01 --results $SBX/repro.jsonl --runs $SBX/runs.jsonl --curve $SBX/fewshot.jsonl --judgments $SBX/judgments.jsonl --a-preds $SBX/a.jsonl --b-preds $SBX/b.jsonl\",shell=True,capture_output=True,text=True,cwd=os.getcwd()); d=json.loads(r.stdout); assert r.returncode==4 and d[\"verdict\"]==\"COMPROMISED\" and d[\"worst_score\"]>=75 and len(d[\"report_sha256\"])==64; m=oct(stat.S_IMODE(os.stat(os.environ[\"BENCHSCAN_LEDGER\"]).st_mode)); assert m==\"0o600\", m'" chk "report findings cite only catalogue ids (anti-hallucination)" "python3 -c 'import json,os,subprocess; cat={k for k in json.loads(subprocess.run([\"python3\",\"scripts/benchscan.py\",\"doctor\"],capture_output=True,text=True).stdout)[\"catalogue\"]}; r=subprocess.run([\"python3\",\"scripts/benchscan.py\",\"report\",\"--name\",\"selftest-bench\",\"--benchmark\",os.environ[\"SBX\"]+\"/bench.jsonl\",\"--corpus\",os.environ[\"SBX\"]+\"/corp.jsonl\",\"--cutoff\",\"2024-06-01\",\"--results\",os.environ[\"SBX\"]+\"/repro.jsonl\",\"--runs\",os.environ[\"SBX\"]+\"/runs.jsonl\",\"--curve\",os.environ[\"SBX\"]+\"/fewshot.jsonl\",\"--judgments\",os.environ[\"SBX\"]+\"/judgments.jsonl\",\"--a-preds\",os.environ[\"SBX\"]+\"/a.jsonl\",\"--b-preds\",os.environ[\"SBX\"]+\"/b.jsonl\"],capture_output=True,text=True); d=json.loads(r.stdout); cats={f[\"cat\"] for f in d[\"findings\"]}; assert {\"C-1\",\"E-1\"} <= cats ...[truncated 25 chars]- Confidence
- 91% confidence
- Finding
- This line invokes subprocess.run with shell=True and interpolates $SBX paths into a shell command string. If SBX or related values were attacker-controlled or unexpectedly contained shell metacharacters, this could lead to command injection during the self-test run; the risk is reduced by mktemp-generated paths but the pattern remains unsafe.
