T09 · Insecure Skill Coding Practices
- Location
SKILL.md:394- Finding
Persistent Plaintext Storage and Automatic Loading of Bitwarden Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 394-431
Vulnerability Type: Plaintext credential storage and persistent shell initialization modification
Risk Level: HighVulnerable Code
bash # Create .secrets file mkdir -p ~/.openclaw/workspace echo "BW_PASSWORD=your_master_password" > ~/.openclaw/workspace/.secrets chmod 600 ~/.openclaw/workspace/.secrets # Add to .gitignore echo ".secrets" >> ~/.openclaw/workspace/.gitignore # Auto-source in shell config (run once) echo 'source ~/.openclaw/workspace/.secrets 2>/dev/null' >> ~/.bashrc # OR for zsh: echo 'source ~/.openclaw/workspace/.secrets 2>/dev/null' >> ~/.zshrcThe same file is also used to persist API credentials:
bash # Add API credentials to .secrets echo "BW_CLIENTID=user.xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" >> ~/.openclaw/workspace/.secrets echo "BW_CLIENTSECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >> ~/.openclaw/workspace/.secrets chmod 600 ~/.openclaw/workspace/.secretsTechnical Analysis
The instructions recommend storing the Bitwarden master password and API secret as plaintext environment assignments in a persistent file. They then permanently modify
.bashrcor.zshrcso that every new interactive shell sources that file.File mode
600and inclusion in.gitignorereduce exposure to other local users and accidental version-control commits, but they do not encrypt the credentials. Secrets remain available to any process or attacker operating under the same user account. They may also be exposed through workstation backups, endpoint inspection tools, accidental file copies, malicious shell configuration, or compromise of the user's home directory.Automatically sourcing the file increases its exposure lifetime and makes sensitive variables available across unrelated shell sessions. Because
BW_PASSWORDis the vault master password, disclosure can en ...[truncated 1716 chars]- Remediation
View remediation
Remediation Suggestions
- Do not store the Bitwarden master password in a persistent plaintext workspace file.
- Prefer interactive password entry through the CLI so the master password is not retained between sessions.
- For automation, retrieve credentials at runtime from an operating-system keychain, hardware-backed secret store, or dedicated secrets-management service.
- Do not add automatic secret-loading commands to
.bashrc,.zshrc, or other persistent shell initialization files. - Keep
BW_SESSIONshort-lived, avoid persisting it, and runbw lockimmediately after the required operation. - If a password file is unavoidable, create it only for the operation, place it in a user-private runtime directory, enforce restrictive permissions before writing, and securely remove it afterward.
- Store API credentials separately from the master password and scope their availability only to the process that requires them.
- Retain mode
600and version-control exclusions as defense-in-depth measures, not as substitutes for encrypted secret storage. - Advise users who already followed these instructions to remove the shell startup entries, delete the plaintext file, rotate the API secret, and change the master password if exposure is suspected.
