T09 · Insecure Skill Coding Practices
- Location
SKILL.md:51- Finding
Broad Git Staging May Persist Sensitive Files in Repository History
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 51–56
Vulnerability Type: Unsafe broad staging of configuration files
Risk Level: MediumVulnerable Code
bash cd ~/.openclaw # Check current status git status # Add all tracked files (respecting .gitignore) git add -A # Create commit with descriptive message git commit -m "checkpoint: {description of pending change}"The same unsafe staging command is repeated in the documented implementation and quick-reference workflow:
text 2. Run: git add -A 3. Run: git commit -m "checkpoint: {description}"The proposed
.gitignoreprotection at lines 158–176 is incomplete:gitignore # Session logs (volatile) *.jsonl *.jsonl.lock *.jsonl.reset.* # Databases (volatile) *.sqlite *.sqlite-journal # Credentials (sensitive) credentials/ *.pem *.key # Temporary files *.tmp *.temp .DS_Store # Logs logs/ # Delivery queue delivery-queue/Technical Analysis
git add -Astages all changes under the repository, including untracked files that are not matched by.gitignore. The documented ignore rules protect only a limited set of credential locations and extensions. They do not account for common secret-bearing files such as.envfiles, token files, cloud-provider credentials, authentication configuration, or sensitive JSON and YAML documents.Consequently, the assertion that credentials are excluded from version control is not reliably enforced. A sensitive file stored anywhere under
~/.openclaw/outside the listed patterns can be added to a checkpoint. Once committed, deleting the working-tree copy does not remove the secret from prior Git objects and commit history.This is an insecure configuration-management practice rather than evidence of intentional exfiltration. The reviewed files contain no network transmission or repository push instruction.
Attack Path
- A user, another skill, or a local process creates a secret-bearing file under
~/.openclaw/...[truncated 1320 chars]
- A user, another skill, or a local process creates a secret-bearing file under
- Remediation
View remediation
Remediation Suggestions
-
Replace
git add -Awith explicit allowlisted paths containing only the configuration files intended for checkpointing. For example:bash git add -- \ workspace/SOUL.md \ workspace/AGENTS.md \ workspace/USER.md \ workspace/IDENTITY.md \ workspace/skills \ workspace/memory \ openclaw.json \ cron/jobs.json -
Before every commit, inspect the exact staged file list and staged diff:
bash git diff --cached --name-only git diff --cached -
Reject suspicious filenames and locations before committing, including
.env*, token or credential files, private keys, cloud-provider configuration, authentication caches, and secret-bearing configuration overrides. -
Expand
.gitignoredefensively, while recognizing that ignore rules are not a substitute for an explicit staging allowlist. Suggested patterns include:gitignore .env .env.* *credentials* *secret* *token* .aws/ .config/gcloud/ .azure/ -
Run a secret scanner against staged content before each checkpoint and abort the commit if likely credentials or private key material are detected.
-
Detect whether a sensitive file is already tracked, because adding it to
.gitignoredoes not stop Git from tracking an existing indexed file. Remove such files from the index and rotate any exposed credentials. -
If a secret has already been committed, rewrite repository history using an appropriate history-cleaning tool, delete obsolete Git objects where necessary, and rotate the affected credential immediately.
-
