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/config/environment and then sends the Bearer API key to that URL without validation. An attacker who can influence A7W_HOST or the saved config can redirect requests to an arbitrary server and capture the credential, turning this into SSRF plus credential exfiltration.
- 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:
