T09 · Insecure Skill Coding Practices
- Location
SKILL.md:383- Finding
Plaintext Duplication of Secret-Bearing OpenClaw Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 383-396
Vulnerability Type: Plaintext sensitive-data duplication and insecure backup handling
Risk Level: MediumVulnerable Code
markdown 4. Configuration backups: - Backup: `openclaw.json -> openclaw.json.backup-YYYYMMDD` - Backup retention: keep at most the last 3 backups - Sync/update independent backups for API keys (if you have files like `.api-keys-backup.env`)bash cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup-$(date +%Y%m%d) ls -t ~/.openclaw/openclaw.json.backup-* | tail -n +4 | xargs -r rm cp ~/.openclaw/openclaw.json ~/.openclaw/.api-keys-backup.envTechnical Analysis
The documented maintenance workflow instructs users to copy the complete
openclaw.jsonconfiguration into dated plaintext backup files and into a hidden file named.api-keys-backup.env.The source configuration may contain API keys, authentication tokens, service endpoints, or other sensitive settings. The commands duplicate the entire file without encryption, destination-permission enforcement, or verification that the backup directory is protected. The effective permissions therefore depend on the invoking process and its
umask.The
.api-keys-backup.envdestination is particularly unsafe because:- It creates another secret-bearing copy rather than minimizing stored sensitive data.
- Its
.env-style name does not reflect that its contents are a complete JSON configuration. - Environment-file discovery, synchronization, backup, or development tooling may process it unexpectedly.
- The workflow does not require exclusion from source control, shared archives, logs, or cloud synchronization.
- Scheduled maintenance can repeatedly recreate or refresh the exposed copy.
This is an insecure backup practice rather than demonstrated malicious credential theft. No outbound exfiltration command exists in the audited project.
Attack Path
- A user adopts the ...[truncated 1539 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove the following command entirely:
bash cp ~/.openclaw/openclaw.json ~/.openclaw/.api-keys-backup.env -
Do not copy the complete configuration merely to back up API keys. Store credentials in a dedicated secret manager or encrypted credential store.
-
If local configuration backups are operationally necessary, place them in a dedicated protected directory and explicitly enforce restrictive permissions:
bash install -d -m 700 ~/.openclaw/backups umask 077 cp -- ~/.openclaw/openclaw.json \ ~/.openclaw/backups/openclaw.json.backup-$(date +%Y%m%d) chmod 600 ~/.openclaw/backups/openclaw.json.backup-* -
Encrypt backups at rest using an approved key-management mechanism. Keep decryption keys separate from the backup files.
-
Exclude configuration backups,
.envfiles, and credential files from version control, cloud synchronization, shared archives, diagnostic bundles, and log collection. -
Back up only required non-secret fields where possible. Apply data minimization rather than cloning the complete configuration.
-
Use an explicit retention implementation scoped to the protected backup directory. Review deletion behavior before enabling it in an unattended scheduled job.
-
Document credential rotation procedures. If any generated backup may already have been exposed, revoke and replace every credential contained in the copied configuration.
-
