Tainted flow: 'req' from os.environ.get (line 444, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 96% confidence
- Finding
The client allows the request destination to be overridden via --host or the A7W_HOST environment variable, and then automatically attaches the Bearer API key to every outbound request. This creates a credential exfiltration path: if an attacker can influence environment variables, wrapper scripts, or invocation arguments, the user's API key will be sent to an arbitrary host over the network.
- 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, status = resp.read().decode("utf-8", "replace"), resp.status except urllib.error.HTTPError as exc: raw, status = exc.read().decode("utf-8", "replace"), exc.code
