T09 · Insecure Skill Coding Practices
- Location
scripts/network_hot_list.py:26- Finding
API Credential Transmitted over Plaintext HTTP
- Content
View full analysis
dict: """Query the network hot list.""" params = urllib.parse.urlencode({"key": api_key}) url = f"{API_URL}?{params}" try: with urllib.request.urlopen(url, timeout=10) as resp: data = json.loads(resp.read().decode("utf-8")) ``` The insecure endpoint is also explicitly documented at `SKILL.md:69`: ```text GET http://apis.juhe.cn/fapigx/networkhot/query?key=YOUR_KEY ``` ### Technical Analysis The script embeds the API key in a URL query parameter and sends the request to an `http://` endpoint. HTTP does not provide transport encryption, server authentication, or integrity protection. Consequently, the API credential and response are visible to systems located along the network path. Query-string credentials can also be retained in HTTP proxy logs, gateway logs, monitoring systems, and server access logs. Although communicating with the Juhe API is necessary for the Skill's declared hot-list functionality, transmitting the credential without TLS exceeds acceptable risk and is not necessary if an HTTPS endpoint is available. The lack of response integrity protection also allows an active network attacker to modify the returned JSON. While the response is only formatted and displayed rather than executed, manipulated data could mislead users or downstream programs consuming the script's JSON output. ### Attack Path 1. A user configures a valid `JUHE_HOTSEARCH_KEY` and runs the Skill. 2. The script constructs a URL containing the credential, such as: `http://apis.juhe.cn/fapigx/networkhot/query?key=SECRET`. 3. The request crosses a network controlle ...[truncated 1068 chars]- Remediation
View remediation
