T09 · Insecure Skill Coding Practices
- Location
README.md:26- Finding
Credential File Is Created Without Restrictive Permissions
- Content
View full analysis
~/.clawdbot/credentials/qbittorrent/config.json << 'EOF' { "url": "http://localhost:8080", "username": "admin", "password": "your-password-here" } EOF ``` The resulting file is subsequently consumed as a credential source: ```bash if [[ -f "$CONFIG_FILE" ]]; then QBIT_URL=$(jq -r '.url // empty' "$CONFIG_FILE") QBIT_USER=$(jq -r '.username // empty' "$CONFIG_FILE") QBIT_PASS=$(jq -r '.password // empty' "$CONFIG_FILE") fi ``` ### Technical Analysis The documented setup stores the qBittorrent username and password as plaintext JSON. Plaintext storage is necessary for the current authentication design, but the setup does not apply a restrictive umask or explicitly set directory and file permissions. The final permissions therefore depend on the user's existing umask. With a permissive configuration, other local users may be able to read the qBittorrent credentials. The credential-directory path is legitimate and does not exceed the functional scope of the Skill, but access to it should be restricted to the owning user. There is also a documentation inconsistency: `README.md` uses `~/.clawdbot/credentials/qbittorrent/config.json`, while `SKILL.md:13` and `scripts/qbit-api.sh:7` use `~/.openclaw/credentials/qbittorrent/config.json`. This primarily causes configuration failures rather than creating a separate vulnerability. ### Attack Path 1. A user follows the documented setup commands. 2. The credential file is created using the user's current umask, without an explicit `0600` mode. 3. On a multi-user system with permissive home-directory and file permissions, another local account enumerates the documented credential path. 4. The attacker reads the qBittorrent URL, us ...[truncated 751 chars]- Remediation
View remediation
"$HOME/.openclaw/credentials/qbittorrent/config.json" <<'EOF' { "url": "https://your-qbit-host:8080", "username": "admin", "password": "your-password-here" } EOF chmod 600 "$HOME/.openclaw/credentials/qbittorrent/config.json" ``` Additional hardening should include: 1. Standardize all documentation and code on the same configuration path. 2. Have the script reject credential files not owned by the current user. 3. Warn or fail when the file is group-readable or world-readable. 4. Recommend a dedicated, least-privileged qBittorrent account where supported. 5. Prefer an operating-system credential store or secret manager instead of persistent plaintext storage. ]]>
