Tainted flow: 'req' from os.environ.get (line 151, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 94% confidence
- Finding
The client allows the network destination to be overridden from the A7W_HOST environment variable or config file, then sends the Bearer API key to that host in the Authorization header. If an attacker can influence the environment, config, or invocation parameters, they can redirect requests to an attacker-controlled server and exfiltrate the credential and submitted data.
- 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:
