T09 · Insecure Skill Coding Practices
- Location
scripts/backup.sh:5- Finding
Sensitive Backup Archives Are Created Without Restrictive Permissions
- Content
View full analysis
/dev/null ``` ### Technical Analysis The script creates the backup directory and archive without setting a restrictive process umask or explicitly applying secure permissions. Consequently, the effective permissions are inherited from the caller's environment. With a common umask such as `022`, the backup directory may be accessible to other local users and the generated archive may be readable beyond its owner. This is especially sensitive because the archived `.openclaw` directory is documented as containing API keys, tokens, authentication profiles, Telegram sessions, agent state, memory, scheduled tasks, and user files. The archive consolidates this sensitive information into a single predictable location, increasing the consequences of unintended local read access. ### Attack Path 1. A user or automated job invokes `scripts/backup.sh` under a permissive umask. 2. `mkdir` and `tar` create the backup directory and archive without explicit restrictive modes. 3. The resulting archive inherits permissions that may permit access by other local accounts or processes. 4. A local attacker identifies an archive under the configured backup directory. 5. The attacker reads and extracts the archive. 6. The attacker obtains any credentials, tokens, session data, configuration, or private workspace content stored in `.openclaw`. This path requires local filesystem access and depends on the effective umask and surrounding directory pe ...[truncated 597 chars]- Remediation
View remediation
