T09 · Insecure Skill Coding Practices
- Location
SKILL.md:159- Finding
Automatic Remote Backup Includes Credentials and Sensitive OpenClaw State
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 159–166
Vulnerability Type: Sensitive data exposure through an unsafe backup configuration
Risk Level: HighComplete Code Snippet
text ## 2. 大脑灾备 - **仓库**:GitHub 私有仓库或其它备份方案 - **备份内容**:`openclaw.json`, `workspace/`, `agents/`, `cron/`, `credentials/`, `identity/`, `devices/paired.json`, `.config-baseline.sha256` - **排除**:`devices/*.tmp`, `media/`, `logs/`, `completions/`, `canvas/`, `*.bak*`, `*.tmp` - **频率**:每日巡检时自动备份Technical Analysis
The Skill instructs the Agent to perform a daily remote Git backup containing
credentials/,identity/,devices/paired.json,openclaw.json, and potentially sensitive data underworkspace/andagents/. These locations can contain authentication material, device-pairing state, configuration secrets, private operational context, or other data that should not be placed directly in Git.A private repository is not a secret-management boundary. Sensitive content committed to Git remains in repository history even after deletion from the latest revision. It may become accessible through compromised Git credentials, excessive collaborator permissions, CI/CD integrations, repository mirrors, accidental visibility changes, local clones, or compromise of the hosting account.
Automatically exporting these paths is not required to perform the declared security-audit function and exceeds the minimum data access and transfer necessary for nightly monitoring. No instruction to encrypt the data before transfer, sanitize secrets, enforce retention controls, or use an explicit non-sensitive allowlist is provided.
Attack Path
- A user follows the Skill and deploys the prescribed nightly audit and backup process.
- The recurring process collects OpenClaw state, including
credentials/,identity/,devices/paired.json, and configuration or workspace data. - The collected files are committed to Git a ...[truncated 1337 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
credentials/,identity/,devices/paired.json, and secret-bearing portions ofopenclaw.jsonfrom the default backup scope. - Replace the broad directory list with an explicit allowlist containing only data demonstrated to be non-sensitive and necessary for disaster recovery.
- Require informed user approval for the backup destination, included files, retention period, repository access policy, and recovery procedure.
- Encrypt backup archives locally before upload using a key stored separately from both the repository and its access credentials.
- Do not commit plaintext secrets to Git, including private repositories. Use an appropriate encrypted backup system or secret manager instead.
- Add automated secret scanning as a pre-commit and pre-push control, and fail closed when potential credentials or private keys are detected.
- Use a dedicated, least-privileged backup identity restricted to one destination and prevent unrelated CI systems or collaborators from reading the backup.
- Define key rotation and incident-response procedures for cases where sensitive content has already entered Git history. Removing the latest file is insufficient; purge historical objects and rotate every potentially exposed credential.
- Minimize retention, maintain access logs, and periodically test restoration from encrypted backups without exposing production secrets.
- Remove
