Tainted flow: 'req' from os.environ.get (line 151, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 96% confidence
- Finding
The client allows the destination host to be overridden via command-line arguments, environment variable (A7W_HOST), or local config, then sends the Bearer API key to that URL with urllib. This creates a credential-exfiltration/SSRF class issue: if an attacker can influence the environment, config, or invocation arguments, they can redirect requests to an attacker-controlled server and capture the API key.
- 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:
