T09 · Insecure Skill Coding Practices
- Location
SKILL.md:44- Finding
Configurable API Endpoint Can Exfiltrate the X2C API Key
- Content
View full analysis
` ### Get Categories ```bash curl -m 60 -X POST "$X2C_API_BASE_URL" \ -H "Content-Type: application/json" \ -H "X-API-Key: $X2C_API_KEY" \ -d '{"action": "distribution/categories", "lang": "zh-CN"}' ``` ``` The same pattern is repeated for the distribution and wallet API operations at lines 62–65, 89–92, 112–115, 124–127, 139–142, 150–153, 160–163, 170–173, 180–183, and 191–194. ### Technical Analysis The Skill obtains the destination URL directly from the configurable `X2C_API_BASE_URL` environment variable and attaches the sensitive `X2C_API_KEY` header to requests sent to that destination. No hostname, scheme, port, or origin validation is specified. Although the documentation claims that the variable defaults to a production endpoint, the reviewed project does not define a concrete default URL or enforce an approved origin. Consequently, an attacker who can influence the Agent's environment or Skill configuration can redirect authenticated requests to an attacker-controlled server. This is a credential-exfiltration flaw caused by combining an untrusted or insufficiently constrained endpoint with a sensitive authentication header. ### Attack Path 1. An attacker gains the ability to influence environment variables or the OpenClaw Skill configuration. 2. The attacker sets `X2C_API_BASE_URL` to an HTTPS endpoint under their control. 3. A user asks the Agent to perform a documented distribution or wallet operation. 4. The Agent follows the Skill instructions and executes `curl` against the attacker-controlled URL. ...[truncated 1019 chars]- Remediation
View remediation
