T09 · Insecure Skill Coding Practices
- Location
SKILL.md:160- Finding
Ambiguous migration instructions may persist plaintext credentials in CLAUDE.local.md
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:148,160;references/CLAUDE-local-template.md:13;references/cruise-intelligence-case-study.md:73-75
Vulnerability Type: Plaintext sensitive-data storage caused by conflicting security instructions
Risk Level: MediumVulnerable Code Snippets
SKILL.md:148:markdown - **Moves to `CLAUDE.local.md`**: any block containing connection strings, passwords, API keys, or internal proxy URLs — convert to env var name references, not inline valuesSKILL.md:160:markdown 3. Create `CLAUDE.local.md` with secrets extracted from existing CLAUDE.md. Verify `git check-ignore`.references/CLAUDE-local-template.md:13:markdown If you must document a specific credential value for a debugging or setup workflow, set a short-lived, read-only, staging-only token and rotate it after the session. Never embed production admin tokens in any file.references/cruise-intelligence-case-study.md:73-75:markdown 2. Add `CLAUDE.local.md` to `.gitignore` 3. Create `CLAUDE.local.md` with all 3 envs' DB URLs, Redis URLs, FalkorDB credentials, GitHub PAT 4. Verify with `git check-ignore -v CLAUDE.local.md` (matched line 70)Technical Analysis
The skill contains conflicting guidance. One instruction correctly requires converting credentials into environment-variable name references, while the execution sequence says to create
CLAUDE.local.mdusing “secrets extracted” from the existing file. The template also explicitly allows a credential value under some circumstances, and the bundled case study demonstrates copying database credentials and a GitHub personal access token into the local file.Adding the file to
.gitignoreonly reduces the probability of committing it to Git. It does not encrypt the file or prevent access by other local users, processes, backup tools, indexing services, endpoint malware, editor extensions, or late ...[truncated 1665 chars]- Remediation
View remediation
Remediation Suggestions
-
Replace
SKILL.md:160with an unambiguous requirement such as:markdown Create `CLAUDE.local.md` containing only public environment URLs and environment-variable names. Never copy credential values from the existing CLAUDE.md. Replace every detected secret with its environment-variable reference or a redacted placeholder. -
Remove the exception permitting temporary credential values from
references/CLAUDE-local-template.md. Require all credentials, including short-lived staging tokens, to remain in environment variables or a dedicated secret manager. -
Rewrite the case-study execution sequence so that it records only variable names such as
STAGING_DATABASE_URLandGITHUB_TOKEN, not their values. -
Add a mandatory secret scan covering both tracked and ignored generated files. The verification should explicitly scan
CLAUDE.local.mdbecause ordinary Git-based scanners may omit ignored files. -
Fail closed when a credential-like value is detected: stop the migration, report the source location, and ask the user to move or rotate the credential.
-
If prior users followed the documented case study, advise them to remove plaintext values and rotate any credentials that may have been exposed.
-
