Customer CSV Export Can Execute Cell Formulas
Level 2 · node · Security · CSV Formula Injection
Scenario
Operators download customer lists as CSV and inspect them in spreadsheet software. Names containing commas or quotes are escaped correctly for CSV syntax, but a security review found that customer-controlled values beginning with =, +, -, or @ can be interpreted as formulas by spreadsheet applications. The export service, CSV helper, and repository are separate.
Requirements
- Export ordinary customer text without changing its content - Escape values containing commas, quotes, or line breaks as valid CSV fields - Export user input beginning with =, +, -, or @ as safe text rather than an executable spreadsheet formula - Do not unnecessarily alter trusted headers or system-generated numeric IDs - Preserve the column structure of every customer row when exporting multiple rows
Acceptance criteria
- An ordinary customer row is exported with the expected CSV values
- A name containing commas and quotes is escaped according to CSV syntax
- A user value beginning with an equals sign is protected from formula interpretation
- User values beginning with +, -, or @ are also exported as safe text
- Headers and row column structure remain intact when multiple customers are exported