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
- 92% confidence
- Finding
- The request destination and authentication header are both derived from environment variables, and the code sends the X-Proxy-Token to whatever URL PROXY_URL contains without validating or allowlisting the host. In a skill/runtime environment where env vars can be influenced, this can exfiltrate the proxy credential to an attacker-controlled endpoint and redirect all fetched data through an untrusted server.
