T09 · Insecure Skill Coding Practices
Error
- Location
- register.sh:14
- Finding
- Published Hard-Coded Webhook Authentication Token<![CDATA[ ## Vulnerability Details **File Location**: `register.sh:14-17`, `register.sh:196-205`; `SKILL.md:33-43`, `SKILL.md:184-201`, `SKILL.md:218-225` **Vulnerability Type**: Hard-coded reusable credential **Risk Level**: High ### Vulnerable Code ```bash # register.sh:14-17 # Default values FUNNEL_URL="${FUNNEL_URL:-https://gregs-mac-mini.taila31444.ts.net}" HOOK_TOKEN="${HOOK_TOKEN:-19e78f0288d476ee1197d4b374b6f73394abe121c12cc38a}" ``` ```bash # register.sh:196-205 ║ Webhook URL: ${WEBHOOK_URL} ╠════════════════════════════════════════════════════════════════╣ ║ Headers to configure: ║ X-Hook-Token: ${HOOK_TOKEN} ║ Content-Type: application/json ... Headers: X-Hook-Token: ${HOOK_TOKEN} Content-Type: application/json ``` ```text # SKILL.md:35-43 https://gregs-mac-mini.taila31444.ts.net/hooks Authentication: Use OpenClaw's hook token in the X-Hook-Token header: X-Hook-Token: 19e78f0288d476ee1197d4b374b6f73394abe121c12cc38a ``` ### Technical Analysis The project embeds both a public webhook endpoint and a reusable authentication token in source code and documentation. `register.sh` uses the published token whenever `HOOK_TOKEN` is not explicitly configured, making the exposed value an operational default rather than merely an example. Secrets committed to a distributed project must be considered compromised. Any person with access to the Skill package or documentation can recover the token. Deployments that retain the default may consequently accept attacker-generated webhook requests as authenticated. The token is also shared across source registrations. Compromise of one integration can therefore affect every integration protected by the same token. ### Attack Path 1. An attacker downloads or inspects the Skill package. 2. The attacker extracts the endpoint and `X-Hook-Token` value from `SKILL.md` or `register.sh`. 3. The attacker submits arbitrary JSON to the documented `/hooks` endpoint using the published token. 4. The ups ...[truncated 945 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Immediately revoke and rotate the published token. 2. Remove the endpoint-specific credential from all source files, examples, generated output, and documentation history. 3. Require `HOOK_TOKEN` to be provided through a protected secret manager or deployment environment: ```bash : "${HOOK_TOKEN:?HOOK_TOKEN must be configured securely}" ``` 4. Do not provide a usable fallback token. 5. Generate a unique, cryptographically random secret during installation when secret-manager integration is unavailable. 6. Use separate secrets for each webhook source so compromise is isolated. 7. Avoid printing complete tokens to standard output; provide a protected configuration file or secret-reference identifier instead. 8. Add automated secret scanning to the repository and release pipeline. 9. Review webhook audit logs after rotation to identify possible requests made with the exposed credential. ]]>
