Tainted flow: 'api_key' from os.environ.get (line 37, credential/environment) → requests.post (network output)
- Category
- Data Flow
- Confidence
- 90% confidence
- Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
- Content
python data["metadata"] = metadata with open(image_path, "rb") as f: files = {"user_image": (os.path.basename(image_path), f)} r = requests.post(ENDPOINT, headers={"x-api-key": api_key}, files=files, data=data, timeout=60) if not r.ok: print(f"Error {r.status_code}: {r.text}", file=sys.stderr) sys.exit(1)
