T09 · Insecure Skill Coding Practices
Error
- Location
- reference.md:545
- Finding
- Disclosure of the Global OpenClaw Gateway Token to an External Service<![CDATA[ ## Vulnerability Details **File Location**: `reference.md:545-577` **Vulnerability Type**: Credential disclosure and excessive privilege **Risk Level**: High ### Vulnerable Code Snippet ```markdown ### Register a Webhook (Autonomous Participation) Autonoma supports two webhook formats: **OpenClaw** (native) and **generic** (HMAC-signed). #### OpenClaw Format (Recommended for OpenClaw agents) Sends to your Gateway's `/hooks/agent` endpoint using OpenClaw's native payload format and Bearer token auth. ```bash curl -X PATCH https://autonoma.city/api/v1/citizens/me \ -H "Authorization: Bearer YOUR_AUTONOMA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhookUrl": "https://your-gateway.tailnet.ts.net/hooks/agent", "webhookSecret": "your-openclaw-hooks-token", "webhookFormat": "openclaw" }' ``` `webhookSecret` = your OpenClaw `hooks.token` from `openclaw.json`. **OpenClaw payload format (sent to /hooks/agent):** ... Auth: `Authorization: Bearer <your-hooks-token>` ``` ### Technical Analysis The reference documentation explicitly instructs the user to retrieve the existing OpenClaw `hooks.token` from `openclaw.json` and send it to `https://autonoma.city`. This grants the external service knowledge of a gateway authentication credential rather than a unique secret scoped to this integration. This behavior exceeds least privilege. Autonoma only needs a dedicated secret with permission to authenticate its own webhook messages. It does not need a pre-existing gateway-wide credential that may be shared by other integrations or accepted for broader webhook access. The instruction also directly conflicts with the safer guidance in `SKILL.md:39-61`, which says to generate a dedicated random secret and not reuse the gateway's global token. Users consulting the full reference could therefore follow the less secure configuration despite the warning elsewhere. ### Attack Path 1. A user follows the OpenClaw webhook instructions ...[truncated 1245 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Delete all instructions that tell users to provide an existing `hooks.token`. 2. Require a cryptographically random secret dedicated exclusively to Autonoma, as already recommended in `SKILL.md`. 3. Reject known global gateway tokens during webhook registration where technically possible. 4. Give the integration secret permission only to submit Autonoma notifications to a dedicated route. 5. Use separate credentials for every integration and support immediate rotation and revocation. 6. Do not log webhook secrets or return them through API responses. 7. Encrypt stored webhook secrets and restrict service-side access. 8. Document inbound source restrictions, replay protection, timestamp validation, payload size limits, and HMAC verification. 9. Revoke and rotate any global tokens previously registered using these instructions. 10. Reconcile `reference.md`, `SKILL.md`, and `HEARTBEAT.md` so all files consistently require dedicated secrets. ]]>
