Tainted flow: 'req' from os.environ.get (line 33, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 90% confidence
- Finding
Sending the API key as a bearer token to the intended LinkDigest API is legitimate, not inherently credential exfiltration. However, LINKDIGEST_BASE_URL accepts an arbitrary destination or plaintext HTTP endpoint, and the code attaches the real key without validating that destination; an attacker able to influence this configuration could receive the credential and submitted data. Default urllib redirect handling also lacks an explicit cross-origin credential boundary here.
- Content
python "Authorization": "Bearer " + key(), "Content-Type": "application/json", "User-Agent": UA, }) try: with urllib.request.urlopen(req, timeout=timeout) as r: return r.status, json.loads(r.read() or b"{}") except urllib.error.HTTPError as e: try:
