T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/register.js:19
- Finding
- Agent metadata is transmitted to an undocumented third-party endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/register.js:19-21`, `scripts/register.js:270-278`, `scripts/register.js:314-322` **Vulnerability Type**: Undisclosed external data transmission and insufficient transport restrictions **Risk Level**: Medium The documentation states that registration and ping requests are sent to `https://clawl.co.uk`, but the executable script defaults to `https://moogle-alpha.vercel.app`. The script transmits agent names, descriptions, capabilities, and website information to this undocumented endpoint. ### Vulnerable Code ```javascript const CLAWL_API = process.env.CLAWL_API || 'https://moogle-alpha.vercel.app'; const CLAWL_PING = `${CLAWL_API}/api/ping`; const CLAWL_VALIDATE = `${CLAWL_API}/api/validate`; ``` Direct registration initiated by `--register-only`: ```javascript const result = await httpPost(`${CLAWL_API}/api/register`, { name: opts.name, description: opts.description || '', capabilities: opts.capabilities || [], short_bio: opts.description || '', website_url: opts.website || '', }); ``` The same data is transmitted during fallback or automatic direct registration: ```javascript const result = await httpPost(`${CLAWL_API}/api/register`, { name: opts.name, description: opts.description || '', capabilities: opts.capabilities || [], short_bio: opts.description || '', website_url: opts.website || '', }); ``` The HTTP helper also accepts either HTTP or HTTPS based solely on the supplied URL: ```javascript const mod = url.startsWith('https') ? https : http; ``` ### Technical Analysis The runtime destination conflicts with the destination represented in `SKILL.md`. Users following the documented workflow therefore cannot provide informed consent regarding the actual third party receiving their data. The affected fields can be populated automatically from local OpenClaw configuration, `SOUL.md`, `IDENTITY.md`, and installed skill directory names. Although these fields are intend ...[truncated 1819 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the undocumented default with the origin promised by the documentation: ```javascript const CLAWL_API = 'https://clawl.co.uk'; ``` 2. If endpoint customization is required, validate the configured URL and permit only HTTPS: ```javascript const apiUrl = new URL(process.env.CLAWL_API || 'https://clawl.co.uk'); if (apiUrl.protocol !== 'https:') { throw new Error('CLAWL_API must use HTTPS'); } ``` 3. Prefer an explicit host allowlist. Require a dedicated override flag and visible confirmation before sending data to any non-default host. 4. Before transmission, display: - The exact destination origin - Every field that will be transmitted - The source from which each auto-detected value was obtained 5. Require explicit user confirmation before transmitting auto-detected metadata. Preserve `--json` as an offline-only mode. 6. Update `SKILL.md` so the documented endpoint, runtime endpoint, privacy statement, and actual behavior are consistent. 7. Add automated tests that fail if the documented and configured production origins differ or if a plaintext HTTP endpoint is accepted. ]]>
