Tainted flow: 'request' from os.environ.get (line 1091, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 94% confidence
- Finding
Sending an environment-sourced API credential to its intended provider is necessary for this skill, not inherently exfiltration. However, the default urllib redirect handler can forward the Authorization header to a different host or an HTTP destination, so a malicious or compromised configured endpoint could redirect the request and expose the credential; _base_url validates only the initial URL.
- Content
python if body is not None: request.add_header("Content-Type", "application/json") try: with urllib.request.urlopen(request, timeout=180) as response: raw = response.read(MAX_JSON_RESPONSE + 1) headers = dict(response.headers.items()) except urllib.error.HTTPError as exc:
