Tainted flow: 'request' from os.environ.get (line 142, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
def request_bytes(request: urllib.request.Request, timeout: int) -> bytes: try: with urllib.request.urlopen(request, timeout=timeout) as response: return response.read() except urllib.error.HTTPError as exc: details = exc.read().decode("utf-8", errors="replace")- Confidence
- 95% confidence
- Finding
- The code allows a caller-controlled base URL from the OPENAI_BASE_URL environment variable or --base-url argument to influence outbound requests, and those requests include the Bearer API key in the Authorization header. An attacker who can control that setting can redirect traffic to an arbitrary server and exfiltrate the API credential, and image_url values returned by the gateway can also trigger secondary arbitrary downloads.
