Tainted flow: 'url' from os.environ.get (line 244, 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
- 91% 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 without validation. In an agent or hosted execution environment, an attacker who can influence environment configuration could redirect requests to an arbitrary host, causing SSRF-like behavior and exfiltration of the AppKey in the query string to an attacker-controlled endpoint.
