T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:16
- Finding
- Relative-Origin API Routing Can Disclose Submission Data to an Unintended Host## Vulnerability Details **File Location**: `SKILL.md`, lines 16–17 and 35; duplicated in English at lines 121–122 and 146 **Vulnerability Type**: Unrestricted relative-origin network destination **Risk Level**: Medium ### Vulnerable Code ```markdown ## 域名与环境 - 生产域名:`https://sidaily.org` - 未指定域名时使用相对路径 `/api/v1/...`,继承当前站点 origin ``` ```markdown 5. 接口:`POST`,URL 相对 `/api/v1/openclaw-capability/submit`,生产 `https://sidaily.org/api/v1/openclaw-capability/submit`,Headers: `Content-Type: application/json`。 ``` The equivalent English instructions state: ```markdown ## Domain & environment - Production: `https://sidaily.org` - When no domain is specified, use relative path `/api/v1/...` (inherit current origin) ``` ```markdown 4. After user confirms submit, call: `POST` → relative `/api/v1/openclaw-capability/submit`, production `https://sidaily.org/api/v1/openclaw-capability/submit`, header `Content-Type: application/json`. ``` ### Technical Analysis The Skill permits the submission API request to inherit the current site's origin instead of requiring the declared production host, `https://sidaily.org`. The submitted payload contains user-provided `title`, `content`, and `pen_name` values. Relative-origin routing makes the effective network destination dependent on the environment in which the Skill executes. If that environment is hosted on, embedded in, or redirected through an untrusted origin, the request can be delivered to an unintended server exposing the same relative path. The explicit confirmation safeguard controls whether the submission occurs, but the confirmation template does not show or require approval of the resolved destination hostname. This behavior exceeds minimum privilege because the declared functionality only requires communication with the dedicated `sidaily.org` capability gateway. Granting the ambient origin authority to receive submission data is unnecessary. ### Attack ...[truncated 1321 chars]
- Remediation
- ## Remediation Suggestions 1. Require the absolute HTTPS endpoint `https://sidaily.org/api/v1/openclaw-capability/submit` for every submission instead of inheriting the current origin. 2. Apply an explicit hostname allowlist that permits only `sidaily.org`, using an exact normalized hostname comparison. 3. Display the complete resolved destination URL in the pre-submission confirmation prompt so the user approves both the payload and its recipient. 4. Reject non-HTTPS destinations, embedded credentials, alternate ports, deceptive subdomains, and URL parsing ambiguities. 5. Reject cross-origin redirects or validate every redirect target against the same hostname allowlist before transmitting or retransmitting the payload. 6. Use the absolute allowlisted production URLs for the latest-issue and review-result queries as well, ensuring consistent endpoint isolation. 7. Treat API responses as untrusted data and validate expected response fields and types before reporting submission success.
