Tainted flow: 'req' from os.environ.get (line 109, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 93% confidence
- Finding
Sending the API key as a bearer token to the intended provider is normal authentication, not inherently credential exfiltration. However, OPENAI_BASE_URL is accepted without transport or destination validation, allowing an insecure HTTP configuration to expose both the key and private conversation excerpts to network interception.
- Content
python ) try: with urllib.request.urlopen(req, timeout=120) as resp: result = json.loads(resp.read()) if "choices" in result and result["choices"]: return result["choices"][0]["message"]["content"]
