Tainted flow: 'req' from os.environ.get (line 151, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 93% confidence
- Finding
The request destination is influenced by the user-controlled A7W_HOST environment variable or CLI --host and then used directly in urllib.request.urlopen while attaching the Bearer API key. This creates an SSRF-style exfiltration risk: a user or calling agent can be induced to send the stored credential to an attacker-controlled host over HTTPS without validation.
- Content
python headers["Content-Type"] = "application/json" req = urllib.request.Request(url, data=data, headers=headers, method=method) try: with urllib.request.urlopen(req, timeout=timeout) as resp: raw = resp.read().decode("utf-8", "replace") status = resp.status except urllib.error.HTTPError as exc:
