T09 · Insecure Skill Coding Practices
- Location
secrets-manager.js:317- Finding
Secret Audit Logs Plaintext Secret Prefixes
- Content
View full analysis
0) { hasIssues = true; console.log(`\n ⚠️ Weak patterns (${findings.patterns.length}):`); for (const f of findings.patterns) { console.log(` ⚠️ ${f.name}: starts with '${f.pattern}'`); } } ``` ### Technical Analysis The audit function decrypts each stored secret and, when the plaintext starts with a recognized weak prefix, copies up to the first ten plaintext characters into an audit finding. That prefix is then printed to standard output. An audit operation should report that a policy violation was detected without reproducing any part of the sensitive value. Standard output may be captured by terminal scrollback, CI/CD logs, journald, centralized log collectors, or Agent conversation transcripts. This behavior also conflicts with the documentation's assertion that secret values are not logged. The exposure occurs during ordinary `--audit` execution and does not require the explicitly sensitive `--get --raw` option. ### Attack Path 1. A secret beginning with `password`, `admin`, `root`, `test`, `demo`, `secret`, `key`, or `token` is stored. 2. A user, scheduled workflow, or Agent runs: ```bash node secrets-manager.js --audit ``` 3. The audit decrypts the secret and copies its first ten characters into `findings.patterns`. 4. The plaintext prefix is printed to standard output. 5. Any user or service with access to captured logs, terminal history, CI output, or Agent transcripts ...[truncated 656 chars]- Remediation
View remediation
