T09 · Insecure Skill Coding Practices
- Location
SKILL.md:207- Finding
Unvalidated External Activity URLs Are Rendered as Trusted Clickable Links
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 207–213, 225–230, and 250–257
Vulnerability Type: Improper validation of externally supplied URLs
Risk Level: MediumVulnerable Code
markdown ## URL Processing Rules All activity URLs returned by API must be processed before displaying to users: | URL Pattern | Processing | Example | |-------------|------------|---------| | Relative path (starts with `/`) | Prepend `https://www.gate.com` | `/competition/xxx` → `https://www.gate.com/competition/xxx` | | Already has host (starts with `http://` or `https://`) | Keep as-is, no modification | `https://www.gate.com/campaigns/xxx` → `https://www.gate.com/campaigns/xxx` |markdown | API Field | Display Label | Processing Rule | |-----------|---------------|-----------------| | `master_one_line` | Activity Title | Display as-is | | `url` | Activity Link | Apply URL Processing Rules (prepend `https://www.gate.com` for relative paths) | | `type_name` | Activity Type | Display the `type_name` value directly (NOT `type_id`) |markdown | Activity Title | Activity Type | Activity Link | |----------------|---------------|---------------| | {master_one_line} | {type_name} | [View Details]({processed_url}) |Technical Analysis
The skill instructs the agent to preserve any API-returned absolute URL beginning with
http://orhttps://without validating its scheme security, normalized hostname, port, user-information component, or relationship to Gate. The resulting value is directly embedded in a user-facing Markdown link labeledView Details.Consequently, a compromised, manipulated, or malformed MCP/API response can supply an attacker-controlled URL such as
https://attacker.example/login. The skill will present that destination with the same trusted-looking label used for legitimate Gate campaigns. Permitting plaintext HTTP also exposes users to network-level interception and link substitution.This is a trust-bou ...[truncated 1526 chars]
- Remediation
View remediation
Remediation Suggestions
- Permit only
httpsURLs; reject plaintexthttpdestinations. - Parse URLs with a standards-compliant URL parser rather than relying on string-prefix checks.
- Normalize and validate the hostname against an explicit allowlist, such as
gate.comand specifically approved Gate subdomains. - Require exact hostname or proper subdomain-boundary matching. Do not use unsafe suffix checks that would accept domains such as
gate.com.attacker.example. - Reject URLs containing user-information components, unexpected ports, malformed or encoded hostnames, control characters, or ambiguous parsing constructs.
- Resolve relative paths against the fixed trusted origin
https://www.gate.com, then validate the final normalized URL under the same policy. - Consider restricting paths to known activity-center route prefixes where operationally possible.
- If validation fails, omit the link and use a safe message such as
Activity link temporarily unavailable. - Apply the same validation to recommendation links and the
My Eventsentry link. - Add tests covering attacker-controlled domains, HTTP URLs, user-information confusion, Unicode or punycode hostnames, suffix-confusion domains, protocol-relative URLs, encoded separators, and unexpected ports.
- Permit only
