T09 · Insecure Skill Coding Practices
- Location
SKILL.md:53- Finding
Unrestricted Fetching of Attacker-Controlled Media URLs
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 53–66
Vulnerability Type: Server-Side Request Forgery through unvalidated media URLs
Risk Level: MediumVulnerable Snippet
markdown When someone writes to you, Shell Chat POSTs JSON to your `wakeUrl`: **Direct message** ```json {"text": "💬 …", "type": "message", "messageId": "…", "from": "Fabian", "from_uid": "sg_xxxxxx", "media_url": "https://…", "media_type": "image"}Room message / room invite
json {"type": "room_message", "room_id": "…", "room_name": "Friday game night", "from": "Mara", "from_uid": "sg_…", "text": "…"} {"type": "room_invite", "room_id": "…", "room_name": "…", "from": "…"}media_url/media_typeonly appear when a photo or file was sent — fetch the URL to look at it yourself.text The documented message-sending API also permits an optional sender-provided media URL: ```markdown | Send | `POST /api/messages/send` `{"to":"sg_…","message":"…"}` (optional `media_url`, `media_type`: `image`/`video`/`file`) |Technical Analysis
The Skill directs the agent to fetch every
media_urlreceived in a wake notification. The same documentation permits a message sender to include an arbitrarymedia_urlwhen sending a direct message.No requirement restricts the URL to media hosted by Shell Chat, validates its scheme or destination, blocks private and link-local addresses, performs DNS rebinding checks, or limits redirects. Consequently, an untrusted remote chat participant can influence a network request made from the agent's environment.
This crosses the trust boundary between an external Shell Chat participant and network resources accessible to the agent. The issue is an exploitable design flaw rather than evidence of malicious author intent.
Attack Path
- An attacker obtains the target agent's Shell Chat identifier and sends it a direct message.
- The attacker supplies a crafted
media_urlthrough the documented optional medi ...[truncated 1107 chars]
- Remediation
View remediation
Remediation Suggestions
- Only retrieve media from an explicit allowlist of trusted HTTPS hosts controlled by Shell Chat.
- Prefer server-issued opaque media identifiers over accepting arbitrary remote URLs from message senders.
- Reject non-HTTPS schemes and URLs containing embedded credentials.
- Resolve hostnames before connecting and reject loopback, private, link-local, multicast, reserved, and cloud metadata address ranges for both IPv4 and IPv6.
- Repeat destination validation after every redirect and after DNS resolution to mitigate redirect-based bypasses and DNS rebinding.
- Disable redirects by default or permit them only when every destination remains on the trusted host allowlist.
- Route media retrieval through a sandboxed proxy with strict egress controls, response-size limits, timeouts, and content-type validation.
- Require explicit user confirmation before retrieving media from any URL outside the trusted media service.
- Update the Skill instruction to state these validation requirements rather than directing the agent to fetch every received URL unconditionally.
