T09 · Insecure Skill Coding Practices
- Location
- PUBLISH_CHECKLIST.md:54
- Finding
- Hardcoded ClawHub Bearer Token in Publishing Documentation<![CDATA[ ## Vulnerability Details **File Location**: `PUBLISH_CHECKLIST.md:54-63` **Vulnerability Type**: Hardcoded authentication secret **Risk Level**: High ### Vulnerable Code ```bash # Using ClawHub CLI or API curl -X POST https://clawhub.ai/api/skills \ -H "Authorization: Bearer [REDACTED_HARDCODED_CLAWHUB_TOKEN]" \ -H "Content-Type: application/json" \ -d '{ "name": "grazer", "description": "Multi-platform content discovery for AI agents", "version": "1.0.0", "tags": ["content-discovery", "ai-agents", "social-media"], "platforms": ["bottube", "moltbook", "clawcities", "clawsta"], "npm_package": "@elyanlabs/grazer", "pypi_package": "grazer-skill", ``` The original file contains a concrete `clh_...` bearer token where the redaction appears above. ### Technical Analysis A bearer token is committed directly to a tracked documentation file. Bearer credentials grant access based solely on possession, so any person who downloads the repository, source distribution, or published package can extract and attempt to reuse it. Documentation files are commonly copied into package artifacts and mirrors. Removing the token in a later commit is insufficient because it may remain available in version-control history, release archives, caches, and previously published packages. The repository does not establish that the exposed token has been revoked. ### Attack Path 1. An attacker downloads or clones the project. 2. The attacker opens `PUBLISH_CHECKLIST.md` and extracts the hardcoded bearer token. 3. The attacker sends requests to the ClawHub API with: ```http Authorization: Bearer <extracted-token> ``` 4. If the token remains active, the attacker invokes any API operation authorized for that credential, potentially including skill registration or modification. 5. The attacker may alter registry metadata or perform other actions under the credential owner's identity. ### Impact Assessment The obtainable privileges are ...[truncated 321 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke and rotate the exposed ClawHub token immediately. 2. Review ClawHub audit logs for unauthorized activity involving the credential. 3. Replace the literal token with an environment-variable reference: ```bash test -n "${CLAWHUB_TOKEN:?CLAWHUB_TOKEN is required}" curl -X POST https://clawhub.ai/api/skills \ -H "Authorization: Bearer ${CLAWHUB_TOKEN}" \ -H "Content-Type: application/json" \ ... ``` 4. Purge the credential from Git history and republish affected release artifacts. 5. Configure automated secret scanning and pre-commit checks to reject bearer tokens. 6. Use narrowly scoped, short-lived publishing credentials where supported. 7. Ensure examples contain unmistakably invalid placeholders rather than realistic credentials. ]]>
