Tainted flow: 'req' from os.getenv (line 86, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 93% confidence
- Finding
Sending the API key to the documented HTTPS service is legitimate authentication, not inherently exfiltration. However, the runner attaches that key to an unvalidated environment-configured destination, permits HTTP, and uses default redirect handling that can forward the custom X-API-Key header across origins. An attacker who can influence the base URL or induce a redirect could therefore obtain the credential; the supplied content does not establish an active malicious destination.
- Content
python headers=build_headers(), ) try: with urllib.request.urlopen(req, context=SSL_CONTEXT) as response: return json.loads(response.read().decode("utf-8")) except urllib.error.HTTPError as exc: print_http_error(exc)
