Tainted flow: 'url' from os.environ.get (line 130, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
""" url = f"{API_BASE_URL}{API_PATH_MAP[command]}?{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
- 89% confidence
- Finding
- The request URL is partially derived from the environment variable `JIKE_API_BASE_URL` and then used in `urllib.request.urlopen`, which can redirect requests to an attacker-controlled host. Because the AppKey is placed in the query string, overriding the base URL can exfiltrate credentials and make the script contact arbitrary internal or external endpoints; in an agent/runtime environment, environment variables are often easier to influence than source code, which increases risk.
