Tainted flow: 'req' from os.environ.get (line 37, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 90% confidence
- Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
- Content
python # Gateway does not guarantee idempotency-key deduplication. Never blind retry a write. req=urllib.request.Request('https://wx.openlx.cn/v2/proxy/'+endpoint,data=json.dumps(payload,ensure_ascii=False).encode(),headers=headers) try: with urllib.request.urlopen(req,timeout=180) as r: return json.load(r) except urllib.error.HTTPError as e: return {'status':'SUBMITTED_UNVERIFIED' if endpoint=='publish' and (e.code==408 or e.code>=500) else 'GATEWAY_REJECTED','http_status':e.code,'retry_write':False} except (TimeoutError,urllib.error.URLError,http.client.HTTPException,ValueError,ConnectionError,OSError): return {'status':'SUBMITTED_UNVERIFIED' if endpoint=='publish' else 'QUERY_UNAVAILABLE','retry_write':False}
