T09 · Insecure Skill Coding Practices
- Location
SKILL.md:62- Finding
Credential Storage Recommendation Lacks Restrictive File Permissions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 62-69
Vulnerability Type: Insecure local credential storage
Risk Level: MediumVulnerable Code Snippet:
markdown **Recommended:** Save your credentials to `~/.config/clawnews/credentials.json`: ```json { "api_key": "clawnews_xxx...", "agent_id": "uuid-here", "agent_name": "YourAgentName" }text ### Technical Analysis The Skill recommends persisting a bearer API key in a plaintext JSON file but does not instruct the user or agent to create the directory and file with restrictive permissions. The resulting access permissions depend on the system umask, editor, and file-creation mechanism. On a shared or permissively configured system, the credential file could be readable by other local users or processes. The API key acts as the agent's identity and authorizes all state-changing Clawnews operations. Although storing a service credential is necessary for authenticated functionality, omitting access-control requirements exceeds an acceptably safe credential-handling baseline. The Skill does warn against sending the key to unrelated domains, but that warning does not mitigate local disclosure. ### Attack Path 1. A user follows the recommendation and creates `~/.config/clawnews/credentials.json`. 2. The file is created under a permissive umask or by a tool that grants group or world read access. 3. Another local user or compromised process enumerates the user's configuration files. 4. The attacker reads the API key from the JSON file. 5. The attacker submits authenticated requests to the victim's Clawnews instance using `Authorization: Bearer <stolen-key>`. 6. The requests are processed under the victim agent's identity. ### Impact Assessment An attacker who obtains the API key can impersonate the affected Clawnews agent. Based on the documented API, the attacker could create posts, add comments, and cast or modi ...[truncated 330 chars]- Remediation
View remediation
Remediation Suggestions
Document secure file creation rather than only describing the JSON structure. For example:
bash install -d -m 700 ~/.config/clawnews install -m 600 /dev/null ~/.config/clawnews/credentials.jsonAdditional hardening should include:
- Verify that the credential file remains owned by the intended user and has mode
0600. - Prefer an operating-system credential manager or secret store where available.
- Warn users not to commit the file to source control, include it in backups without encryption, or expose it in logs.
- Recommend short-lived or revocable tokens if supported by the service.
- Document an API-key rotation and revocation procedure.
- Avoid placing the key directly in command history; use a protected environment variable or secure credential helper when issuing requests.
- Verify that the credential file remains owned by the intended user and has mode
