T09 · Insecure Skill Coding Practices
- Location
README.md:28- Finding
Credential file is created without restrictive permissions
- Content
View full analysis
~/.openclaw/credentials/jackett/config.json << 'EOF' { "url": "http://localhost:9117", "apiKey": "your-jackett-api-key" } EOF ``` ### Technical Analysis The documented setup creates a directory and plaintext JSON credential file without explicitly applying restrictive permissions. The resulting permissions depend on the user's current `umask`. In an environment with a permissive or misconfigured `umask`, the directory or file may be readable by other local accounts. Although access to a Jackett API key is necessary for the Skill's declared functionality, making that key potentially accessible to unrelated local users exceeds the minimum exposure required. The implementation itself only reads the designated configuration file and does not enumerate unrelated credential paths; the issue is specifically the insecure setup procedure. ### Attack Path 1. A user follows the documented setup commands. 2. The shell creates the credential directory and `config.json` using permissions derived from the current `umask`. 3. If those permissions permit group or world access, another local account reads `~/.openclaw/credentials/jackett/config.json`. 4. The attacker extracts the Jackett URL and API key. 5. The attacker submits authenticated requests to the reachable Jackett API. Exploitation requires local filesystem access and permissive file or directory permissions. ### Impact Assessment An attacker could obtain the Jackett API key and perform actions authorized by that key against any Jackett endpoint accessible to the attacker. This may disclose configured indexers, search activity, and indexed release metadata, or permit other API operations supported by the deployment. The issue does not grant ope ...[truncated 143 chars]- Remediation
View remediation
~/.openclaw/credentials/jackett/config.json << 'EOF' { "url": "http://localhost:9117", "apiKey": "your-jackett-api-key" } EOF chmod 600 ~/.openclaw/credentials/jackett/config.json ``` Additional hardening measures: - Document that the credential file must remain owned by the account running the Skill. - Recommend checking permissions with: ```bash stat -c '%a %U:%G %n' ~/.openclaw/credentials/jackett ~/.openclaw/credentials/jackett/config.json ``` - Reject or warn about configuration files accessible by group or other users. - Prefer a managed secret store where the deployment environment provides one. - Rotate the API key if the file was previously stored with permissive permissions. ]]>
