T09 · Insecure Skill Coding Practices
Error
- Location
- RETRY_PUBLISH.txt:1
- Finding
- Plaintext ClawHub Publishing Token Included in Project<![CDATA[ ## Vulnerability Details **File Location**: `RETRY_PUBLISH.txt:1` **Vulnerability Type**: Hardcoded plaintext credential **Risk Level**: High ### Vulnerable Code ```bash Retry: CLAWHUB_TOKEN=clh_[REDACTED] npx clawhub publish ./rollhub-auditor --slug rollhub-auditor --name 'Fairness Auditor' --version 1.0.0 ``` The original file contains the complete token; it is redacted here to prevent further credential exposure. ### Technical Analysis A ClawHub publishing token is stored directly in a project file. Any user, automated scanner, build system, package consumer, or source-control collaborator with access to the artifact can retrieve the credential without authentication. Secrets embedded in distributed artifacts must be considered compromised because deleting the current file does not remove copies from package archives, caches, logs, forks, or repository history. ### Attack Path 1. An attacker obtains the project artifact or reads its source history. 2. The attacker extracts the `CLAWHUB_TOKEN` value from `RETRY_PUBLISH.txt`. 3. The attacker presents the token to the ClawHub CLI or API. 4. If the token remains valid and has publishing privileges, the attacker publishes or modifies content authorized by the token. 5. Downstream users may receive attacker-controlled Skill content under a trusted package identity. ### Impact Assessment If valid, the token can expose the publishing privileges assigned to its owner. Potential consequences include unauthorized package publication, package tampering, malicious release distribution, reputational damage, and downstream supply-chain compromise. The exact scope is limited by the token's server-side permissions, which cannot be determined from static analysis. This issue does not directly grant operating-system privileges on a consumer's machine, but compromised releases could subsequently target package users. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke the exposed token immediately and generate a replacement. 2. Audit ClawHub publication and account logs for unauthorized activity. 3. Remove the token from the current artifact and all accessible repository history. 4. Store replacement credentials in a protected secret manager or CI/CD secret store. 5. Pass the secret through a protected environment variable only at execution time. 6. Restrict the replacement token to the minimum required package, operation, and lifetime. 7. Add secret scanning to commits, build artifacts, and release pipelines. 8. Prevent environment variables and command lines containing secrets from being printed to logs. ]]>
