A customer name, note or order reference can leave an application as text and be read as a formula when a teammate opens the CSV in a spreadsheet. The outcome depends on the value, the reader and the import path. Before an automated export is shared, identify who controls each field and which application will open it.
Short answer
Treat untrusted fields beginning with =, +, -, @ or control characters as potential formulas, not approved instructions. OWASP documents CSV formula injection and warns that quotes or an apostrophe may fail after saving and reopening in Excel. When writing directly to Google Sheets, its API offers RAW and USER_ENTERED: RAW keeps =1+1 as text; USER_ENTERED parses it as a formula. That API setting does not protect a separate CSV opened by a person.
Release card by destination
| Reader | Decision before release | Block when |
|---|---|---|
| Excel or another human-opened spreadsheet | Parse the real file, examine external cells, select a reader-specific defense, then open, save and reopen a harmless sample in an isolated environment | A field becomes a formula again after reopening |
| Google Sheets API | Write external strings with RAW; keep intentional formulas in a separate controlled path |
The workflow feeds untrusted input through USER_ENTERED |
| Another system importing CSV | Follow that consumer’s data contract; verify that any added prefix or tab does not change identifiers | The mitigation changes the record or breaks the import |
Pulse’s original decision card: field and source → actual reader → observed prefix → chosen handling → result after reopen/import → owner → release or block. This is an editorial model, not a claim that Pulse tested a customer’s export. Use a harmless =1+1 sample, not a network formula or private record, to see how the reader interprets a cell.
A practical export handoff
Imagine a US customer support team exporting customer comments for review in Excel. In Canada or the UK, the same risk exists, but the separator and spreadsheet settings can differ. Do not infer the CSV delimiter from the country. Parse according to the actual file contract and inspect each resulting cell: a delimiter or quote inside a comment can move a dangerous prefix to the start of a new cell. Checking only the first character of the raw comment is insufficient.
A typed XLSX output may be an option if the team controls both ends; validate the resulting cell type in the actual reader. If the handoff must be CSV, choose a mitigation that works in that reader and repeat the save/reopen check. OWASP describes a tab prefix inside a quoted field as an Excel-specific mitigation, but that tab remains in the data and may damage downstream imports. There is no universal escaping rule for every spreadsheet and consumer.
If the confirmed destination is Excel and people will read the CSV: parse the actual format into cells, wrap each field in double quotes and double any quote inside a field. For each external cell beginning with =, +, - or @, add a tab before the value inside that quoted field, following OWASP’s Excel-specific mitigation. Apply it per parsed cell, not merely to the raw row. Generate a harmless sample, open it in the team’s Excel version, confirm =1+1 remains text, save, close and reopen to check again. The tab becomes part of the data; create a separate output for a software importer if its contract cannot accept it. If these conditions cannot be verified, do not distribute the CSV.
Block the handoff if the reader is unknown, the save/reopen behavior cannot be checked, the handling changes business data, or an external cell still becomes a formula. For delimiter, date and amount interpretation, use the CSV locale guide. To isolate side effects before turning on the workflow, see testing before activation.