T09 · Insecure Skill Coding Practices
- Location
scripts/redact_helpers.sh:4- Finding
Broad Local Evidence Collection Uses Incomplete Redaction and Does Not Enforce Secure Output Permissions
- Content
View full analysis
"$OUT_PATH" <- Remediation
View remediation
"$OUT_PATH" chmod 600 "$OUT_PATH" ``` A production implementation should additionally use exclusive creation and verify file ownership and type to mitigate symlink and replacement races. 2. **Replace denylist redaction with structured allowlisting** - Parse JSON outputs where available and retain only fields explicitly required by the audit. - Avoid storing full command responses when a boolean, count, status, or normalized endpoint is sufficient. - Treat unknown fields as sensitive by default. 3. **Do not preserve credential suffixes** - Replace secret values completely with a constant marker such as `[REDACTED]`. - If correlation is required, use a non-reversible keyed identifier rather than exposing credential characters. 4. **Reduce pattern-scan output** - Record only file path, line number, and matched rule identifier. - Do not store the complete matching source line. - Add an explicit opt-in before scanning directories outside the standard state or workspace skill roots. 5. **Constrain configured extra directories** - Canonicalize each path. - Reject symlinks and paths outside explicitly approved roots. - Require user confirmation before scanning externally configured directories. - Maintain strict depth, file-size, and file-type limits. 6. **Expand secret-detection testing as defense in depth** - Add tests for PEM private keys, URL credentials, JWTs, webhook URLs, single-quoted values, multiline values, multiple secrets per line, Unicode, and provider-specific credentials. - Treat regex redaction only as a ...[truncated 348 chars]
