Tainted flow: 'req' from os.environ.get (line 75, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"}, ) try: with urllib.request.urlopen(req, timeout=30) as resp: data = json.loads(resp.read().decode("utf-8")) return data["choices"][0]["message"]["content"].strip() except Exception as e:- Confidence
- 91% confidence
- Finding
- The code constructs an outbound HTTP request using `OPENAI_BASE_URL` and `OPENAI_API_KEY` taken directly from environment variables, then sends retrieved document content and the user question to that endpoint. In this skill’s context, that creates a real exfiltration risk if the environment is misconfigured or attacker-controlled, because sensitive local knowledge-base text and credentials may be transmitted to an untrusted external service.
