Tainted flow: 'url' from os.environ.get (line 139, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
""" url = f"{API_BASE_URL}{API_PATH}?{urllib.parse.urlencode({**params, 'appkey': appkey})}" try: with urllib.request.urlopen(url, timeout=15) as response: return json.loads(response.read().decode("utf-8")) except urllib.error.HTTPError as exc: return {"code": exc.code, "message": f"接口请求失败: HTTP {exc.code}", "data": ""}- Confidence
- 92% confidence
- Finding
- The request URL is built from JIKE_API_BASE_URL, which is taken directly from an environment variable, and then passed to urlopen(). In environments where attackers or untrusted wrappers can influence environment variables, this can redirect requests and the included appkey to an arbitrary host, enabling SSRF-like behavior and credential exfiltration.
