T09 · Insecure Skill Coding Practices
- Location
publish.py:10- Finding
Hard-Coded ClawHub Bearer Token in Source Code
- Content
View full analysis
" ``` The embedded token is subsequently attached to outbound requests: ```python resp = requests.post( "https://clawhub.ai/api/cli/upload-url", headers={"Authorization": f"Bearer {TOKEN}"}, json={"filename": filename, "contentType": content_type} ) ``` ```python resp = requests.post( API_URL, headers={"Authorization": f"Bearer {TOKEN}"}, data={"payload": json.dumps(payload)}, files=file_data ) ``` The credential value has been redacted from this report to prevent further disclosure. The audited source contains the complete plaintext token. ### Technical Analysis The application embeds a live-looking ClawHub bearer token directly in distributable Python source. Anyone who can read the project can extract this credential without needing access to a protected configuration file or credential store. The token is automatically supplied to ClawHub as an HTTP `Authorization` bearer credential. Bearer tokens generally grant access based solely on possession, so an attacker can replay the credential from another system. Embedding it also causes every installation of the Skill to share one identity, preventing reliable attribution and violating least-privilege credential management. The network transmission of selected Skill files is consistent with the declared publishing functionality and is not, by itself, unauthorized exfiltration. The security defect is that publication is performed using an embedded shared credential rather than an explicitly configured, user-specific credential. ### Attack Path 1. An attacker obtains a copy of the Skill package or read access to `publish.py`. 2. The attacker extracts the plaintext token assigned to `TOK ...[truncated 1167 chars]- Remediation
View remediation
