T09 · Insecure Skill Coding Practices
- Location
scripts/verify_url.sh:4- Finding
Curl Option Injection Through an Unvalidated Verification URL
- Content
View full analysis
[expected_snippet]}" SNIPPET="${2:-}" TMP="$(mktemp)" CODE=$(curl -sSL -o "$TMP" -w "%{http_code}" "$URL" || true) ``` ### Technical Analysis The script passes the user-controlled `URL` argument directly to `curl` without first validating it and without using the `--` end-of-options delimiter. Shell quoting prevents word splitting and shell metacharacter interpretation, but it does not prevent the invoked program from interpreting an argument beginning with `-` as a command-line option. Consequently, a value such as `--config=/path/to/file` or an equivalent short option can be interpreted as a curl option rather than as a URL. If an attacker can place or reference a crafted curl configuration file, that configuration can specify additional URLs, uploads, proxy settings, request headers, output destinations, or local file URLs. The script also lacks restrictions on URL schemes and destinations. This makes the option-injection weakness more consequential and permits requests to unintended internal or local resources if malicious curl behavior is introduced. ### Attack Path 1. An attacker influences the URL supplied to `verify_url.sh`. 2. The attacker supplies an option-shaped value, such as a curl configuration directive referencing a crafted or attacker-controlled local configuration file. 3. The script passes the value to `curl` without an option terminator. 4. Curl interprets the value as an option instead of a deployment URL. 5. Directives from the referenced configuration can cause unintended network requests, local-file access, file uploads, or writes to attacker-selected paths. 6. These operations execute with the filesystem and network privileges of the user or Agent running the Skill. ### Impact Assessment Successful explo ...[truncated 541 chars]- Remediation
View remediation
