Skip to content

Why customer data in a CSV export can become a formula

Read this article in ไทย 中文

Why customer data in a CSV export can become a formula

Our system exports it, but someone else supplied the data

A team downloads a customer list from its own company system and assumes it is safe to open in a spreadsheet. Yet a name or note may have been supplied by an outsider. OWASP describes CSV injection as untrusted file content being interpreted as a formula. The export and consumption process must address this; ownership of the exporting website is not enough.

Separate stored text from authorised calculations

Harmless hypothetical test: a note contains =1+1 and is intended to remain the submitted text. If opening the file produces the calculated value 2, that path has not preserved the intended data type. This tests behaviour only; do not use formulas that contact external systems or real customer data.

Define types separately for identifiers, names, notes, quantities and amounts. Keep calculations generated by the application distinct from user-submitted text. Stripping leading characters from every field can alter negative amounts, phone numbers or meaningful identifiers. Do not overwrite original records merely to make one export look tidy.

Choose the consumer before the transformation

A file for staff to read and a file for software to import have different data contracts. For human viewing, consider a format with explicit text cells, such as XLSX where supported, and ensure the exporter actually writes text rather than formulas. System interchange needs agreed column types, encoding and an approved importer. Use distinct names and download paths so people choose correctly.

Wrapping a value in quotes is not a complete solution. OWASP warns that some escaping behaviour changes when a CSV is saved and reopened, and no single sanitisation strategy fits every application and downstream consumer. Adding characters to prevent interpretation can also alter values received by another system. Test both security and data fidelity along the actual path.

Test the complete journey, not only the first open

Build synthetic data containing a harmless formula test, quotes, delimiters, line breaks, leading-zero identifiers and legitimate negative quantities. Specify expected results by column. Export, open in the actual application and version, save, close and reopen; if the process includes another import, inspect that destination too. Record raw values, displayed values and data types rather than relying only on screenshots or row counts.

Contain the workflow before changing records

If the test file still becomes a formula, stop using that export path for uncontrolled external input. Give the maintainer the synthetic sample, steps and application versions; do not ask users to dismiss warnings. After the fix, repeat the same journey and ensure the new format does not corrupt accounting or ERP imports. If a real file was opened and behaved unexpectedly, security staff should assess that incident separately from repairing the exporter.

For a discussion with Chawinnix about business systems and IT security, map who supplies the data, which menu exports it, who opens it and where it goes next, using a sample without confidential information. This makes controls and acceptance criteria specific to the workflow rather than simply asking for a safe file.

A data grid passes through a blue shield into documents, with an amber cell separated for review

Sources

Back to all articles

Start the conversation

Tell us briefly what concerns you and our team will get back to you. What you send stays confidential.