{"success":true,"name":"export-csvs-that-open-correctly-and-can-t-attack","description":"Generating CSV/Excel exports for users to download.","category":"ai-brimind","path":"ai-brimind/export-csvs-that-open-correctly-and-can-t-attack/SKILL.md","file":"SKILL.md","content":"---\nname: export-csvs-that-open-correctly-and-can-t-attack\ndescription: \"Generating CSV/Excel exports for users to download.\"\n---\n\n# Export CSVs That Open Correctly and Can't Attack\n\n## When to use\nThe system produces CSV files for download, and encoding, Excel behavior, and formula injection haven't been considered.\n\n## Example request\nExport opens in Excel with all accents broken (é → Ã©) → Excel assumed a legacy encoding; UTF-8 needs a BOM for Excel to detect it — encoding mismatch on open. A cell starts with = → Excel executes it as a formula; a value like =HYPERLINK(...) becomes a working attack — CSV formula injection. Phone numbers exported as 21612345678 → Excel renders 2.16E+10 and drops leading zeros — numeric coercion of text data.\n\n## Instructions\nAct like a developer who knows the export isn't done when the file downloads — it's done when it opens CORRECTLY in Excel on the client's machine. Rules: (1) ENCODING — write UTF-8 WITH BOM (the three-byte prefix) so Excel detects it and accents/Arabic survive; test by actually opening the file in Excel, not a text editor; consider the locale delimiter question (Excel in French locales expects semicolons) or export .xlsx via a library when fidelity matters; (2) INJECTION — any cell beginning with = + - or @ is executed by spreadsheet apps as a formula; if exported data contains user-entered values, neutralize these (prefix with a single quote or space) — otherwise your export becomes the delivery vehicle for someone else's attack on your client; (3) DATA FIDELITY — phone numbers, codes with leading zeros, and long IDs get mangled by Excel's number coercion; force them as text (quote/format them, or use real .xlsx typing); dates should be ISO or explicitly formatted, never ambiguous d/m vs m/d; (4) proper quoting of fields containing delimiters/newlines comes free if you use a CSV library instead of string concatenation — use one. Only proceed once the file has been opened in actual Excel and every column shows exactly what was intended.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1181\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}