Tainted flow: 'OPENAI_BASE' from os.environ.get (line 31, credential/environment) → requests.post (network output)
Critical
- Category
- Data Flow
- Content
log(f" 调用 {OPENAI_MODEL} 生成 {cfg['name']} 内容...") try: resp = requests.post( f"{OPENAI_BASE}/chat/completions", headers={ "Authorization": f"Bearer {OPENAI_API_KEY}",- Confidence
- 95% confidence
- Finding
- The request URL is built from the OPENAI_BASE environment variable and the code sends the Authorization bearer token plus full user content to that destination without validation. If an attacker can influence the environment, they can redirect traffic to a malicious endpoint and capture the API key and all submitted prompts, making this a real SSRF/credential-exfiltration risk in shared or untrusted deployment environments.
