Tainted flow: 'req' from os.environ.get (line 31, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
headers = {"Content-Type": "application/json", "X-Proxy-Token": PROXY_TOKEN} req = urllib.request.Request(PROXY_URL, data=payload, headers=headers, method="POST") try: with urllib.request.urlopen(req, timeout=timeout) as resp: return json.loads(resp.read().decode("utf-8")) except (socket.timeout, TimeoutError): return {"ok": False, "error": "timeout"}- Confidence
- 93% confidence
- Finding
- The request URL and authentication header are both sourced from environment-controlled values and then sent via urllib without validation. If an attacker can influence PROXY_URL or the deployment environment, they can redirect requests and the X-Proxy-Token to an attacker-controlled host, causing credential leakage and unintended outbound data exfiltration.
