T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Plaintext Credentials Are Promoted to Permanent Git-Tracked Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:43-48and supporting recovery documentation atSKILL.md:61-66
Vulnerability Type: Plaintext sensitive-data persistence
Risk Level: HighVulnerable Instruction
markdown ## Promotion Protocol Before deleting ANY session file, extract: 1. Credentials/keys → permanent (NEVER lose these) 2. Architecture decisions → permanent/business-strategy.md 3. Infrastructure changes → permanent/outreach-infrastructure.md 4. New project summaries → permanent/projects/[name].md 5. User preferences → permanent/user-system.mdThe related recovery instructions establish that memory is tracked in Git:
markdown ## Emergency Recovery Everything is git-tracked. If memory corrupts: 1. `git log memory/` → find last good state 2. `git checkout <hash> -- memory/` → restore 3. Rebuild MEMORY.md index from `ls memory/permanent/`Technical Analysis
The promotion protocol explicitly instructs an agent to extract credentials and keys from temporary session files and place their values into permanent memory. The emergency-recovery section states that memory is Git-tracked.
This violates secure secret-management principles in two ways:
- Sensitive values are deliberately persisted in ordinary memory documents rather than an approved secret manager.
- Git may retain every committed version of those values in repository history, so deleting or redacting the current file does not reliably remove the secret.
The accompanying
scripts/memory_check.pyscanner does not identify, redact, encrypt, or otherwise protect secrets. Its integrity and duplicate checks hash complete file contents with MD5, but that hash operation does not protect the underlying plaintext files.Attack Path
- A user or integrated service provides an API key, password, access token, private key, or another credential during a session.
- The credential appears in a session memory file.
- Before stale-session cleanup, an age ...[truncated 1082 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to copy credential values into permanent memory.
- Replace it with a rule that memory may contain only a non-sensitive secret identifier, purpose, owner, and secret-manager reference.
- Store secrets in an approved secret manager or platform credential store with encryption, access control, audit logging, rotation, and expiration.
- Explicitly prohibit committing passwords, tokens, API keys, private keys, recovery codes, and credential-bearing configuration files to Git.
- Add pre-commit, CI, and periodic repository-history secret scanning. Block commits when suspected secrets are found.
- Apply restrictive filesystem permissions and repository access controls to memory data.
- Redact sensitive values before writing session transcripts or memory documents.
- If credentials have already been stored, revoke and rotate them first, then purge them from repository history and invalidate affected clones, caches, backups, and artifacts where feasible.
- Add an automated check to
memory_check.pythat reports likely secrets without printing their values. Detection should complement, not replace, prevention and proper secret storage.
