Tainted flow: 'req' from os.environ.get (line 188, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 97% confidence
- Finding
Reading the API key and sending it as an authorization header is legitimate for the explicitly requested connectivity test, and the initial URL is guarded. However, the default urllib redirect handling can forward that header to an unvalidated destination, making this credential-to-network flow exploitable rather than inherently critical merely because authentication occurs.
- Content
python code = None raw = "" try: with urllib.request.urlopen(req, timeout=args.timeout) as resp: code, raw = resp.status, resp.read().decode("utf-8", "replace") except urllib.error.HTTPError as err: detail = ""
