Tainted flow: 'fn' from open (line 185, file read) → open (file write)
Medium
- Category
- Data Flow
- Content
"staggerLabels": True, "offsetRange": [18, 80], "offsetStep": 6, "minLabelGap": 12}} fn = f"/tmp/ac_{spec['page']}.json" json.dump(acspec, open(fn, "w"), ensure_ascii=False) rc, out, err = run(["sch", "autoconnect", "--spec", fn, "--json"], 600) res = jparse(out).get("result") or {} results = res.get("results") or res.get("connections") or []- Confidence
- 94% confidence
- Finding
- The script writes to `/tmp/ac_{spec['page']}.json` using untrusted `spec['page']` data without sanitization. An attacker who controls the spec can use path traversal sequences or predictable temporary-file races to overwrite unintended files writable by the current user, especially in multi-user environments.
