Tainted flow: 'req' from os.environ.get (line 42, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 90% confidence
- Finding
Sending credentials to the intended authentication API is legitimate, not inherently exfiltration. However, login and registration POSTs include plaintext password fields and use HUANGLI_BASE without validating its scheme or destination, so an attacker-influenced or mistakenly configured base can send credentials to an arbitrary server or over unencrypted HTTP.
- Content
python def post_json(url, payload): body = json.dumps(payload).encode('utf-8') req = urllib.request.Request(url, data=body, method='POST', headers={'Content-Type': 'application/json'}) with urllib.request.urlopen(req) as resp: return resp.getcode(), json.loads(resp.read())
