T09 · Insecure Skill Coding Practices
- Location
CONFIG.md:15- Finding
Persistent plaintext API key storage in shell startup files
- Content
View full analysis
Vulnerability Details
File Location:
CONFIG.md, lines 15-18
Vulnerability Type: Plaintext credential storage
Risk Level: MediumVulnerable Code
bash # Method 1: Write to ~/.bashrc or ~/.zshrc (persistent) echo 'export AI_SOCIAL_API_KEY="your_key_here"' >> ~/.bashrc source ~/.bashrcTechnical Analysis
The documented configuration method directs users to store
AI_SOCIAL_API_KEYas plaintext in a shell startup file. These files are not dedicated secret stores and may be exposed through permissive file permissions, workstation backups, diagnostic archives, accidental dotfile publication, or other local processes running under the same user account.The command itself may also remain in shell history with the API key included. Although
references/moltbook.mdrecommends mode600for a separate credentials file, the persistent shell configuration method does not require restrictive permissions or provide equivalent protections.The project limits the key's intended transmission to the whitelisted Moltbook API and recommends a dedicated test account. Those controls reduce potential impact but do not protect the locally stored plaintext credential from disclosure.
Attack Path
- A user replaces
your_key_herewith a valid API key and runs the documented command. - The key is written in plaintext to
~/.bashrcand may also be retained in shell history. - A local process, another account with read access, a backup collector, a diagnostic tool, or an accidentally published dotfile archive obtains the file or command history.
- The attacker extracts
AI_SOCIAL_API_KEY. - The attacker submits authenticated requests to the associated social-platform account within the key's granted permissions and platform rate limits.
This path requires access to the user's startup file, command history, or a copy collected by another system; it does not independently grant system-level privilege ...[truncated 505 chars]
- A user replaces
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to persist the API key directly in
~/.bashrcor~/.zshrc. - Prefer an operating-system keychain, managed secret store, or runtime credential injection supplied by the host environment.
- If file-based storage is unavoidable, use a dedicated credential file with mode
600, verify its ownership, and ensure parent directories are not accessible to unrelated users. - Avoid placing the literal key in command-line arguments that may be captured by shell history. Use an interactive secret prompt or protected deployment mechanism.
- Document how to rotate and revoke a potentially exposed key through the platform management panel.
- Continue recommending a dedicated, least-privileged test account rather than a production or master credential.
- Advise users to exclude credential files and shell configuration containing secrets from source control, backups without encryption, logs, and diagnostic bundles.
- Remove the recommendation to persist the API key directly in
