T09 · Insecure Skill Coding Practices
- Location
index.js:7- Finding
Unrestricted API Base URL Allows Requests to Attacker-Controlled Hosts
- Content
View full analysis
{ const qs = new URLSearchParams(params).toString(); const url = `${API}${path}${qs ? '?' + qs : ''}`; https.get(url, { headers: { 'User-Agent': 'OpenClaw-SUPAH-Whale-Tracker/1.2.0' } }, res => { ``` ### Technical Analysis The `SUPAH_API_BASE` environment variable is accepted without validating its protocol, hostname, port, credentials, or path components. It is then concatenated directly with an API path and used as the destination of an outbound HTTPS request. This behavior conflicts with the declared outbound network boundary in `SKILL.md`, which identifies only `api.supah.ai`. An attacker or compromised deployment configuration capable of setting `SUPAH_API_BASE` can redirect requests to an arbitrary HTTPS server. User-supplied token identifiers and wallet addresses are incorporated into endpoint paths for the `track`, `watch`, and `analyze` commands. Redirecting the base URL can therefore disclose those queries to an unauthorized service. The hostile service can also return fabricated JSON that the CLI prints without establishing that it came from the intended SUPAH API. ### Attack Path 1. An attacker gains control over the environment used to launch the skill, or supplies a malicious deployment configuration. 2. The attacker sets `SUPAH_API_BASE` to an attacker-controlled HTTPS origin. 3. A user invokes a command such as `watch 0x...`, `track TOKEN`, or `analyze TOKEN`. 4. The skill appends the command-derived endpoint to the malicious base URL. 5. The wallet address, token identifier, and request intent are transmitted to the attacker-controlled server. 6. The server returns arbitrar ...[truncated 758 chars]- Remediation
View remediation
