T09 · Insecure Skill Coding Practices
- Location
redact_patterns.py:96- Finding
Generic API keys may remain exposed because unmatched capture groups produce invalid replacement boundaries
- Content
View full analysis
- Remediation
View remediation
= 0`, `end >= start`, and `value is not None` before creating a `RedactionMatch`. Fail closed if these invariants are violated. - Separate generic and labeled API-key detection into distinct `RedactionPattern` objects if their match semantics differ. - Add regression tests for both alternatives, including standalone long tokens, labeled tokens, quoted values, and report mode. - Verify that the original credential is absent from `redacted_text`, not merely that a match object was produced. ]]>
