T09 · Insecure Skill Coding Practices
- Location
scripts/hunter_batch_cli.py:139- Finding
Hunter API Key Transmitted in URL Query Parameters
- Content
View full analysis
bool: # 轮询导出任务,直到完成或超时 status_url = f"{API_URL}/{task_id}" params = {"api-key": api_key} deadline = time.time() + timeout_sec print("\n开始轮询任务进度...") while time.time() < deadline: try: # 查询当前任务进度 resp = requests.get(status_url, params=params, timeout=30) ``` ```python def _download_result(task_id: str, api_key: str, output_file: Optional[str] = None) -> Optional[Path]: """下载导出结果文件,成功返回本地文件路径。""" download_url = f"{DOWNLOAD_BASE_URL}/{task_id}" params = {"api-key": api_key} fallback_name = output_file or f"hunter_task_{task_id}.csv" try: resp = requests.get(download_url, params=params, timeout=60, stream=True) ``` ```python response = requests.post(API_URL, params=params, timeout=30) ``` ### Technical Analysis The code includes the Hunter API key in the `params` argument of both GET and POST requests. Python Requests serializes `params` into the URL query string, so the resulting URLs contain `api-key=`. TLS protects the request from passive network interception, but it does not prevent URLs from being recorded by components that legitimately process or observe the request. Potential recording locations include: - Hunter server access logs - Forward or reverse proxy logs - Endpoint monitoring and observability systems - Debug-level HTTP client logs - Exception and diagnostic output containing the prepared request URL - Redirect-handling infrastructure The network connection itself is necessary for the Skill's declared Hunter export functionality, and the requests are directed to the documented `hunter.qianxin.com` service. The is ...[truncated 1109 chars]- Remediation
View remediation
