T09 · Insecure Skill Coding Practices
- Location
publish.py:10- Finding
Hard-Coded ClawHub Bearer Token Exposes Publishing Credentials
- Content
View full analysis
Vulnerability Details
File Location:
publish.py, lines 10-19; the same credential is also used at line 73
Vulnerability Type: Hard-coded authentication secret
Risk Level: Highpython TOKEN = "clh_[REDACTED]" API_URL = "https://clawhub.ai/api/v1/skills" def upload_file(filename, content_type="text/plain"): """获取上传URL并上传文件""" resp = requests.post( "https://clawhub.ai/api/cli/upload-url", headers={"Authorization": f"Bearer {TOKEN}"}, json={"filename": filename, "contentType": content_type} )The token value is redacted in this report to avoid further credential exposure. The source file contains the complete plaintext credential.
Technical Analysis
A reusable ClawHub bearer token is embedded directly in the source code and added to the
Authorizationheader. The same token is also used by the publication request at line 73. Anyone able to download, inspect, copy, log, or redistribute the Skill package can recover the credential without authentication or technical exploitation.Embedding an account credential is not required for the declared publishing functionality. Authentication should instead be supplied by the individual authorized user through a protected runtime mechanism. Because bearer tokens generally grant access based solely on possession, an attacker can replay the token directly against ClawHub APIs until it is revoked or expires.
Attack Path
- An attacker obtains the Skill package or access to its source code.
- The attacker reads the plaintext
TOKENvalue frompublish.py. - The attacker constructs requests with
Authorization: Bearer <token>. - The attacker sends authenticated requests to the ClawHub upload or publishing APIs.
- The attacker exercises any publishing or account capabilities granted to the token until the credential is revoked, expires, or is otherwise invalidated.
Impact Assessment
The ...[truncated 550 chars]
- Remediation
View remediation
Remediation Suggestions
- Immediately revoke the exposed token and issue a replacement; removing it from the current source alone does not invalidate copies in package archives or source history.
- Remove all embedded credentials from the code and repository history.
- Obtain authentication from a protected environment variable, operating-system credential store, or official interactive ClawHub authentication flow.
- Fail securely when no credential is configured rather than falling back to a shared token.
- Use narrowly scoped, short-lived credentials restricted to only the publication operations required by the tool.
- Avoid printing tokens or including them in exceptions and HTTP debugging logs.
- Add automated secret scanning to development and release pipelines.
- Review ClawHub access and publication logs for unauthorized activity associated with the exposed credential.
