T09 · Insecure Skill Coding Practices
- Location
index.js:12- Finding
Unrestricted API Destination Override
- Content
View full analysis
{ const options = { hostname: API_BASE, port: 443, path: reqPath, method: 'GET', headers: { 'User-Agent': 'OpenClaw-SUPAH-Portfolio-Guardian/1.2.0' } }; ``` ### Technical Analysis The destination hostname for every portfolio request is read directly from the `SUPAH_API_BASE` environment variable without validation or an allowlist. This conflicts with the skill metadata, which declares outbound access only to `api.supah.ai`. Although HTTPS is used, HTTPS authenticates whichever hostname the application has been configured to contact. It does not prevent an attacker who can influence the process environment from setting the hostname to an attacker-controlled TLS server. Wallet addresses subsequently supplied to portfolio commands would then be transmitted to that server. The unrestricted override also increases the effect of the response-handling weakness because a redirected server can intentionally return malformed, oversized, or indefinitely streaming responses. ### Attack Path 1. An attacker or compromised launcher modifies `SUPAH_API_BASE` in the environment used to start the skill. 2. The value is set to an attacker-controlled hostname with a valid TLS certificate. 3. A user invokes `watch`, `health`, `alerts`, or `rebalance`. 4. `apiRequest()` connects to the attacker-controlled hostname instead of `api.supah.ai`. 5. The attacker receives the requested wallet address and can return manipulated portfolio data or a denial-of-service response. ### Impact Assessment This issue does not directly provide local code execution or access to private wallet keys. Its scope includes: - Disclo ...[truncated 410 chars]- Remediation
View remediation
