T09 · Insecure Skill Coding Practices
- Location
scripts/backup.sh:13- Finding
Broad Git staging can upload sensitive files without encryption
- Content
View full analysis
Vulnerability Details
File Location:
scripts/backup.sh:13-16; related encryption configuration inSKILL.md:39-63
Vulnerability Type: Sensitive data exposure caused by incomplete path-based encryption and unrestricted staging
Risk Level: HighVulnerable Code
scripts/backup.sh:13-16:bash if [[ -n $(git status --porcelain) ]]; then git add -A git commit -m "Auto backup: $TIMESTAMP" git pushThe relevant encryption configuration documented in
SKILL.md:39-63only protects selected paths:text SOUL.md filter=git-crypt diff=git-crypt USER.md filter=git-crypt diff=git-crypt HEARTBEAT.md filter=git-crypt diff=git-crypt MEMORY.md filter=git-crypt diff=git-crypt memory/** filter=git-crypt diff=git-crypttext clawdbot.json filter=git-crypt diff=git-crypt .env filter=git-crypt diff=git-crypt credentials/** filter=git-crypt diff=git-crypt telegram/** filter=git-crypt diff=git-crypt identity/** filter=git-crypt diff=git-crypt agents/**/sessions/** filter=git-crypt diff=git-crypt nodes/** filter=git-crypt diff=git-cryptTechnical Analysis
The backup script uses
git add -A, which stages every changed, deleted, or newly created file in each repository. Encryption is instead based on a finite list of path patterns in.gitattributes. Files that do not match those patterns are stored in Git as plaintext.This design fails open: newly introduced credential formats, secrets placed in unexpected directories, and sensitive files omitted from the documented patterns are silently committed without encryption. The documentation explicitly identifies files such as
cron/jobs.json,settings/**,AGENTS.md,IDENTITY.md, andTOOLS.mdas plaintext, although such operational or identity-related files may contain sensitive information.The script does not verify that:
git-cryptis initialized and active;- required
.gitattributesrules e ...[truncated 1643 chars]
- Remediation
View remediation
Remediation Suggestions
- Adopt encryption by default and explicitly exempt only reviewed, non-sensitive files. For example, apply the git-crypt filter broadly and maintain a minimal plaintext allowlist.
- Alternatively, replace
git add -Awith a strict allowlist of paths that are intended to be backed up. - Before committing, enumerate staged files and use
git check-attr filter --cached -- <files>to ensure every sensitive file is covered bygit-crypt. Abort the backup when validation fails. - Verify that
git-cryptis initialized, the repository is unlocked where required, and the expected.gitattributesrules are present before staging data. - Add automated secret scanning to the staged diff and fail closed if credentials, tokens, private keys, or other sensitive patterns are detected.
- Verify and document that each remote repository is private and restrict repository membership according to least privilege.
- Review existing Git history for plaintext secrets. If exposure has already occurred, rotate affected credentials and purge sensitive objects from all branches and tags using a history-rewriting tool.
- Add tests covering unexpected filenames and directories to ensure future configuration changes cannot silently bypass encryption.
