Tainted flow: 'req' from os.getenv (line 64, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
url_value = item.get("url") file_path = out_dir / f"image-{int(time.time())}-{index}.png" req = urllib.request.Request(url_value, headers={"User-Agent": args.user_agent}) with urllib.request.urlopen(req) as res: file_path.write_bytes(res.read()) print(f"SUCCESS: {out_dir}")- Confidence
- 82% confidence
- Finding
- The script downloads a URL returned by the remote AIMLAPI service and fetches it without validating the scheme, host, or content type. If the upstream service is compromised or returns attacker-controlled URLs, this can trigger server-side request forgery behavior or unexpected network access from the machine running the script, even though the static taint source attribution to the API key is likely imprecise.
