T09 · Insecure Skill Coding Practices
- Location
SKILL.md:138- Finding
Automatic Fetching of Untrusted QR URLs Enables SSRF and Local Resource Access
- Content
View full analysis
&1 # Step 2: Check with browser-like UA curl -sL --max-redirs 10 --connect-timeout 10 \ -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15" \ "URL_HERE" | head -c 5000 # Step 3: Check with WeChat UA (reveals WeChat-gated content) curl -sL --max-redirs 10 --connect-timeout 10 \ -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 MicroMessenger/8.0.0" \ "URL_HERE" | head -c 5000 ``` The requests are automatically initiated by the following workflow: ```text When the user provides a QR code image, run the full pipeline automatically: 1. DECODE the image 2. If the decoded content is a URL: a. TRACE the redirect chain b. INSPECT the final destination for gates c. DIAGNOSE with full report ``` ### Technical Analysis The decoded QR value is attacker-controlled input. The Skill instructs the Agent to pass that value directly to `curl` without validating its scheme, host, resolved IP address, port, or redirect destinations. Shell quoting prevents ordinary shell metacharacter injection, but it does not make the requested resource safe. An attacker can encode URLs that point to: - Loopback services such as `http://127.0.0.1`; - Private network services such as RFC 1918 addresses; - Link-local or cloud metadata endpoints; - Internal hostnames resolvable only from the victim environment; - Local resources through schemes supported by the installed `curl`; - Public endpoints that redirect to restricted network destinations. The use of `--max-redirs` permits redirect traversal, but every redirect target is ...[truncated 1710 chars]- Remediation
View remediation
