T09 · Insecure Skill Coding Practices
- Location
lean-report.py:558- Finding
Unsanitized Audited Data Enables Terminal Escape-Sequence Injection
- Content
View full analysis
= 40 and not is_main: penalties += 8 results["waste_tokens"] += tokens results["findings"].append(("fail", f" {key}: {pct}% ({tokens:,} tokens) — bloated")) results["stale"] += 1 elif pct >= 25 and age_hours > 24 and not is_main: penalties += 4 results["waste_tokens"] += tokens results["findings"].append(("warn", f" {key}: {pct}% ({tokens:,} tokens), {age_hours:.0f}h stale")) results["stale"] += 1 elif pct >= 60 and is_main: penalties += 5 results["findings"].append(("warn", f" {key}: {pct}% — main session running hot")) ``` The resulting messages are written directly to an ANSI-capable terminal: ```python for level, msg in audit["findings"]: if level == "fail": print(f" {RED}✗{RESET} {msg}") elif level == "warn": print(f" {YELLOW}⚠{RESET} {msg}") elif level == "pass": print(f" {GREEN}✓{RESET} {msg}") else: print(f" {DIM}ℹ{RESET} {msg}") ``` ### Technical Analysis Cron names, cron IDs, and se ...[truncated 2401 chars]- Remediation
View remediation
