Tainted flow: 'req' from os.environ.get (line 61, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
try: import urllib.request req = urllib.request.Request(f"{OLLAMA_HOST}/api/tags") with urllib.request.urlopen(req, timeout=5) as resp: data = json.loads(resp.read()) return len(data.get("models", [])) > 0 except:- Confidence
- 95% confidence
- Finding
- The code builds outbound HTTP requests from the OLLAMA_HOST environment variable with no validation or allowlist, then sends requests via urllib.request.urlopen. An attacker who can influence environment variables can redirect these requests to arbitrary internal or external endpoints, creating an SSRF-style primitive and potentially exfiltrating prompts or probing local network services.
