T09 · Insecure Skill Coding Practices
- Location
scripts/audit_logger.py:291- Finding
Spreadsheet Formula Injection in Audit Log Exports
- Content
View full analysis
- Remediation
View remediation
str: text = "" if value is None else str(value) effective = text.lstrip(" \t\r\n") if effective.startswith(("=", "+", "-", "@")): return "'" + text return text ``` Apply this helper to every CSV field: ```python safe_row = { key: self._spreadsheet_safe(value) for key, value in row.items() } writer.writerow(safe_row) ``` For XLSX, sanitize each string before appending and explicitly set cells to string values where practical. Do not rely solely on spreadsheet-client warnings. ]]>
