T09 · Insecure Skill Coding Practices
- Location
README.md:17- Finding
Moltbook credential file may be created with overly permissive filesystem permissions
- Content
View full analysis
Vulnerability Details
File Location:
README.md:17-25,SKILL.md:17-25, andscripts/moltbook.sh:34-36
Vulnerability Type: Insecure storage of plaintext API credentials
Risk Level: MediumThe documented credential setup writes a plaintext Moltbook API key to a file but does not enforce restrictive permissions on either the containing directory or the credential file.
Complete relevant snippets:
README.md:17-25andSKILL.md:17-25:bash mkdir -p ~/.config/moltbook cat > ~/.config/moltbook/credentials.json << 'EOF' { "api_key": "your_api_key_here", "agent_name": "YourAgentName" } EOFscripts/moltbook.sh:34-36:bash echo "Option 2 - Credentials file:" echo " mkdir -p ~/.config/moltbook" echo " echo '{\"api_key\":\"your_key\",\"agent_name\":\"YourName\"}' > ~/.config/moltbook/credentials.json"Technical Analysis
The final permissions of files created through shell redirection are derived from the process umask. Because the setup does not establish a restrictive umask or explicitly apply mode
0600, environments with a permissive umask may createcredentials.jsonso that other local users can read it. Likewise,mkdir -pdoes not correct insecure permissions on an existing directory.The script subsequently reads the key from this file and uses it as a Bearer token for authenticated requests to the fixed Moltbook API endpoint. Reading a Moltbook credential is necessary for the declared functionality and does not, by itself, exceed minimum privilege. The security issue is the failure to protect the plaintext credential at rest.
The alternative access to
${HOME}/.openclaw/auth-profiles.jsonis limited to extracting.moltbook.api_key; no evidence was found that unrelated credentials are collected or transmitted.Attack Path
- A user follows the documented fallback setup instructions.
- The shell creates `~/.config/moltbook/credentials.js ...[truncated 1044 chars]
- Remediation
View remediation
Remediation Suggestions
-
Create the credential directory with owner-only permissions:
bash install -d -m 700 "${HOME}/.config/moltbook" -
Set a restrictive umask before creating the credential file and explicitly enforce mode
0600:bash umask 077 cat > "${HOME}/.config/moltbook/credentials.json" << 'EOF' { "api_key": "your_api_key_here", "agent_name": "YourAgentName" } EOF chmod 600 "${HOME}/.config/moltbook/credentials.json" -
Update both
README.mdandSKILL.md, as well as the error guidance inscripts/moltbook.sh, so every fallback setup path uses the hardened procedure. -
Prefer the platform-managed OpenClaw credential store over a standalone plaintext JSON file when available.
-
Before reading the fallback file, optionally reject or warn about unsafe permissions. For example, verify that it is owned by the current user and is not readable or writable by group or other users.
-
Document token revocation and rotation procedures for cases where credential exposure is suspected.
-
