T09 · Insecure Skill Coding Practices
- Location
wechat-dl.sh:9- Finding
Unrestricted URL Retrieval Enables Server-Side Request Forgery
- Content
View full analysis
/tmp/wechat_tmp.html ``` ### Technical Analysis The script is documented as a WeChat article downloader, but it passes the first command-line argument directly to `curl`. It does not validate the URL scheme, destination hostname, resolved IP address, or redirect destination. The `-L` option instructs `curl` to follow redirects. Consequently, validating only the initially supplied URL would also be insufficient: an allowed public URL could redirect the request to localhost, a private network address, a link-local service, or a cloud instance metadata endpoint. This creates an SSRF-like request primitive whenever an untrusted party can influence the URL passed to the Skill. The response is stored on the local filesystem and subsequently inspected and processed by the script. There is no evidence that the response is automatically exfiltrated to an external party, which limits the impact compared with a fully interactive SSRF vulnerability. ### Attack Path 1. An attacker causes the Agent or user to invoke `wechat-dl.sh` with an attacker-controlled URL. 2. The supplied URL directly targets an internal resource, or an attacker-controlled public endpoint redirects to one. 3. `curl -L` sends the request from the machine running the Skill and follows the redirect. 4. The internal response is written to `/tmp/wechat_tmp.html`. 5. If the response contains the expected `js_content` marker, portions of it may be extracted into the chosen output file ...[truncated 924 chars]- Remediation
View remediation
