T09 · Insecure Skill Coding Practices
- Location
scripts/config.sh:4- Finding
Plaintext SSH Credentials Stored with Unsafe Permissions and Exposed by Configuration Display
- Content
View full analysis
> "$CONFIG_FILE" echo "✅ Default password set: ***" shift 2 ;; # ... if [ -f "$CONFIG_FILE" ]; then sort -u "$CONFIG_FILE" > "${CONFIG_FILE}.tmp" mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE" fi ``` ### Technical Analysis The script writes the SSH password directly to `~/.config/openclaw/cross-agent.conf` without setting a restrictive `umask` or explicitly applying secure permissions to the directory and file. With a common `022` umask, the directory may be created as `0755` and the configuration file as `0644`, allowing other local users to read the stored password. The deduplication operation creates a second plaintext file, `${CONFIG_FILE}.tmp`, using the process's default permissions and then replaces the original configuration with that file. This can undo manually hardened permissions on the original file. The `show_config` function prints the complete configuration with `cat`, including every `default_pass` entry. Although password output is masked while setting the value, invoking `config --show` or completing a configuration operation can expose the actual password in terminal output, captured logs, or calling-process output. ### Attack Path 1. A user runs `config --default-pass` or saves credentials through the interactive wizard. 2. The password is written in plaintext to `~/.config/openclaw/cross-agent.conf`. 3. The file or its temporary replacement is c ...[truncated 802 chars]- Remediation
View remediation
