T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/register.js:22
- Finding
- Undisclosed Transmission of Local Agent Metadata to a Configurable Third-Party Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/register.js:22`, `scripts/register.js:93-154`, `scripts/register.js:257-265`, and `scripts/register.js:310-318` **Vulnerability Type**: Undisclosed metadata transmission and insufficient destination validation **Risk Level**: Medium ### 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`; ``` The script automatically reads local agent identity and capability information: ```javascript function autoDetect() { const detected = {}; // Try reading OpenClaw config const configPaths = [ path.join(process.env.HOME || process.env.USERPROFILE || '', '.openclaw', 'openclaw.json'), path.join(process.cwd(), '.openclaw', 'openclaw.json'), path.join(process.cwd(), 'openclaw.json'), ]; for (const configPath of configPaths) { try { if (fs.existsSync(configPath)) { const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); if (config.agent?.name) detected.name = config.agent.name; if (config.agent?.description) detected.description = config.agent.description; // Gateway URLs no longer sent (security — removed from protocol) console.log(`📋 Found OpenClaw config at ${configPath}`); break; } } catch (e) { /* skip */ } } // Try reading SOUL.md for identity const soulPaths = [ path.join(process.cwd(), 'SOUL.md'), path.join(process.env.HOME || process.env.USERPROFILE || '', 'clawd', 'SOUL.md'), ]; for (const soulPath of soulPaths) { try { if (fs.existsSync(soulPath)) { const soul = fs.readFileSync(soulPath, 'utf8'); const nameMatch = soul.match(/\*\*Name\*\*:\s*(.+)/); const roleMatch = soul.match(/\*\*Role\*\*:\s*(.+)/); if (nameMatch && !detected.name) detected.name = nameMatch[1].trim(); if (roleMatch & ...[truncated 5241 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the default Vercel endpoint with the official, documented registration origin, or explicitly document and justify the separate service provider. 2. Enforce an allowlist of approved API hostnames rather than accepting an unrestricted `CLAWL_API` value. 3. Require the destination URL to use HTTPS and reject plaintext HTTP. 4. Display the exact destination and complete outbound payload before transmission. 5. Require explicit user confirmation before sending auto-discovered identity or capability metadata. 6. Make local identity discovery opt-in, particularly for files under the user's home directory. 7. Provide separate flags for each metadata source, such as `--read-openclaw-config`, `--read-identity`, and `--discover-skills`. 8. Minimize transmitted fields and allow users to remove or edit discovered values before registration. 9. Document all third-party processors, endpoint domains, transmitted fields, and retention expectations in `SKILL.md`. 10. Retain `--json` as an offline mode and clearly recommend it when users only need manifest generation. ]]>
