T09 · Insecure Skill Coding Practices
- Location
SKILL.md:95- Finding
Unvalidated Remote Media Download and Processing
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 95-98
Vulnerability Type: Unrestricted remote resource retrieval followed by unsafe media parsing
Risk Level: Mediumbash curl -sL "GIF_URL" -o /tmp/gif.gif ffmpeg -i /tmp/gif.gif -movflags faststart -pix_fmt yuv420p \ -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" /tmp/gif.mp4 -y cp /tmp/gif.mp4 /root/.skill-platform/workspace/gif.mp4Equivalent download-and-conversion patterns also appear at lines 116-119, 133-136, and 184-191.
Technical Analysis
The Skill instructs the Agent to follow redirects with
curl -L, download a selected URL, and immediately process the response withffmpeg. It does not require validation of:- The URL scheme or destination host
- Redirect destinations
- Response size
- MIME type or media signature
- Download and conversion time limits
- Media dimensions, frame count, or decompression limits
Although quoting the URL prevents direct shell metacharacter injection, it does not prevent retrieval from an unintended host or scheme. If an attacker can influence a search result, selected URL, or user-supplied URL, the Agent may request internal or otherwise unauthorized resources. The resulting attacker-controlled bytes are then passed to a complex native media parser.
Malformed media may consume excessive CPU, memory, or disk space. It could also exercise a vulnerability in the locally installed
ffmpegversion. The document does not pin or verify the converter version and does not require media conversion to occur inside a restricted sandbox.Attack Path
- An attacker supplies or influences a URL presented as a GIF search result.
- The Agent inserts that value into the documented
curl -sLcommand. curlretrieves the resource and follows redirects without checking that the final destination remains on an approved Tenor or Giphy media host.- The response is stored locally regardless of its a ...[truncated 1036 chars]
- Remediation
View remediation
Remediation Suggestions
- Accept only
https://URLs and validate them with a structured URL parser rather than string-prefix checks. - Maintain an explicit allowlist of approved Tenor and Giphy media hosts.
- Resolve and validate every redirect target; reject redirects to unapproved hosts, private IP ranges, loopback addresses, link-local addresses, and local schemes.
- Add strict connection, transfer, and total-operation timeouts.
- Enforce a conservative maximum response size before conversion.
- Verify both the response MIME type and the downloaded file signature.
- Apply limits for dimensions, duration, frame count, output size, CPU time, and memory.
- Run
ffmpegas an unprivileged user in a sandbox with no network access and access only to a private input/output directory. - Pin
ffmpegto a supported, patched version and apply security updates. - Require explicit user confirmation of the selected media and recipient before sending.
- Accept only
