T09 · Insecure Skill Coding Practices
- Location
scripts/summarize.sh:14- Finding
Insufficient URL Validation Enables SSRF and Local File Disclosure
- Content
View full analysis
/dev/null) ``` ### Technical Analysis The validation checks only whether the supplied string contains the substring `http`. It does not verify that the parsed URL uses the `http` or `https` scheme, despite the error message claiming that requirement. Because curl supports protocols other than HTTP by default, a crafted value such as: ```text file:///etc/passwd#http ``` can satisfy the substring check while directing curl to retrieve a local file. The retrieved data is processed by the Python extractors and included in the script's output. The script also accepts HTTP(S) URLs targeting loopback, private, link-local, and otherwise reserved addresses. This enables server-side request forgery against services accessible from the host. The `-L` option follows redirects without validating each redirect destination, so an initially public URL can redirect to an internal service or a non-HTTP resource supported by curl. Fetching user-selected web pages is necessary for the declared summarization functionality. Access to local files, private networks, cloud metadata services, and non-HTTP protocols exceeds the minimum privileges required. The pre-scan warning concerning remote script execution is not confirmed: curl output is assigned to `CONTENT` and processed as data; it is not piped into Bash or otherwise executed as shell code. ### Attack Path #### Local-file disclosure 1. An attacker supplies a crafted argument containing `http` but using the `file` sche ...[truncated 1757 chars]- Remediation
View remediation
