T09 · Insecure Skill Coding Practices
- Location
security-scan.py:181- Finding
Detected Secrets Are Printed Verbatim to Terminal and CI Logs
- Content
View full analysis
1 else ''})") for issue in type_issues: print(f" - {issue['file']}:{issue['line']}: \"{issue['match']}\"") else: print(f"[OK] {issue_type}: CLEAN (0 found)") ``` ### Technical Analysis The scanner stores the complete text matched by its credential-detection expressions and then prints that value without redaction. Depending on the finding type, `issue['match']` can contain a complete API key, authentication token, password, private key assignment, or other secret. Although the scanner does not transmit findings over a network itself, terminal output is frequently captured by CI/CD systems, build logs, shell-session recording, centralized logging agents, or shared audit artifacts. Consequently, a secret initially confined to a source file can be copied into additional systems with broader access and longer retention periods. The documentation recommends using the scanner in CI/CD, increasing the practical likelihood that its output will be retained. ### Attack Path 1. A scanned project contains an API key, token, password, or secret matching one of the configured expressions. 2. A developer or automated pipeline runs `security-scan.py` as recommended. 3. `scan_file()` stores the complete matched assignment in the `match` field. 4. `print_results()` interpolates the unredacted value into terminal output. 5. The terminal or CI system retains the output in a log. 6. A user with access to those logs, but not necessarily the original source repository or secret-bearing file, obtains the credential. ### Impact As ...[truncated 596 chars]- Remediation
View remediation
