T09 · Insecure Skill Coding Practices
Warning
- Location
- README.md:26
- Finding
- Credential file is created without restrictive permissions<![CDATA[ ## Vulnerability Details **File Location**: `README.md:26-34` **Vulnerability Type**: Plaintext credential file with unspecified access permissions **Risk Level**: Medium ```bash mkdir -p ~/.clawdbot/credentials/qbittorrent cat > ~/.clawdbot/credentials/qbittorrent/config.json << 'EOF' { "url": "http://localhost:8080", "username": "admin", "password": "your-password-here" } EOF ``` ### Technical Analysis The documented setup stores the qBittorrent username and password in plaintext but does not apply restrictive permissions to either the credential directory or the resulting file. Their effective permissions therefore depend on the user's current `umask`. Access to qBittorrent credentials is necessary for the declared WebUI management functionality and does not inherently exceed least privilege. The weakness is the absence of controls ensuring that only the account running the Skill can read the credentials. On a multi-user system with a permissive `umask`, the file may be readable by other local users. The documentation also does not warn users that the file contains a reusable password. ### Attack Path 1. A user follows the documented setup commands with a permissive `umask`. 2. The resulting `config.json` is created with group-readable or world-readable permissions. 3. Another local user reads `~/.clawdbot/credentials/qbittorrent/config.json`. 4. The attacker extracts the qBittorrent WebUI URL, username, and password. 5. If the WebUI is reachable by the attacker, those credentials are used to authenticate and invoke management APIs. ### Impact Assessment Successful exploitation grants the privileges associated with the configured qBittorrent WebUI account. This can include: - Viewing torrent names, trackers, tags, categories, and save paths. - Adding or controlling torrents. - Changing transfer limits. - Removing torrents. - Deleting downloaded files through the WebUI deletion API. The issue does not directly grant operating-syste ...[truncated 58 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions Set a restrictive `umask` before creating credential material and explicitly enforce permissions: ```bash umask 077 install -d -m 700 "$HOME/.clawdbot/credentials/qbittorrent" cat > "$HOME/.clawdbot/credentials/qbittorrent/config.json" <<'EOF' { "url": "http://localhost:8080", "username": "admin", "password": "your-password-here" } EOF chmod 600 "$HOME/.clawdbot/credentials/qbittorrent/config.json" ``` The script should also validate before reading the file that it is: - A regular file rather than a symbolic link. - Owned by the current user. - Not readable or writable by group or other users. Where supported by the hosting environment, prefer a dedicated secret store over a long-lived plaintext password file. ]]>
