T09 · Insecure Skill Coding Practices
Error
- Location
SKILL.md:82- Finding
Unquoted Remote URL Interpolation Can Enable Shell Command Injection
- Content
View full analysis
--output for file in ; do expected_mime= test -s "$file" [[ "$(file --brief --mime-type "$file")" == $expected_mime ]] done ``` ### Technical Analysis The documented command inserts `` and `` directly into a shell command without requiring quoting, validation, or safe argument construction. The deliverable URL is derived from a remote RunAPI response and therefore crosses a trust boundary. If an agent replaces the placeholders textually and executes the resulting shell command, shell metacharacters contained in a malicious or compromised response—such as command separators, substitutions, redirections, or newline characters—can be interpreted as shell syntax instead of data. The output filename and expanded downloaded-file list present similar risks if they are externally influenced. The use of `curl --location` also permits redirects without documenting protocol or destination restrictions. Although redirects alone do not establish command execution, they increase exposure to unintended network destinations and untrusted content. ### Attack Path 1. An attacker compromises, impersonates, or otherwise influences the API endpoint or task response that provides the deliverable URL. 2. The response contains a URL value with shell metacharacters or command-substitution syntax. 3. An agent follows the Skill and substitutes that value directly for `` in the documented shell command. 4. The shell parses the attacker-controlled characters as command syntax because the value is not safely quoted or passed as an isolated argument. 5. The injected command execut ...[truncated 987 chars]- Remediation
View remediation
