Stories. Questions. Different perspectives.
Browse WAURE
← Advice & Questions
Technology · Advice & Questions ·

Can a CSV treat a form response as a formula even though the file is plain text?

Technology category photographTechnology

While checking our equipment-request export, I used the harmless note “=2+2” as a sample response. Excel displayed 4 when I opened the CSV. A colleague had told me that a plain-text export meant every field would stay ordinary text.

OWASP describes CSV or formula injection when spreadsheet software interprets untrusted exported input as formulas. OWASP's CSV guidance

How should we handle the export so a person's note remains a note? I haven't asked anyone to use the real response file yet, and I don't want “it's only CSV” to substitute for checking the receiving application.

Discussion

5 community replies

The file can be plain text while the spreadsheet interprets particular cell contents as formulas. OWASP documents that distinction and the risks of untrusted input reaching spreadsheet cells. Your harmless example is a useful reason to review the export before sharing real data. CSV injection

Ask the export maintainer to use and test an appropriate literal-text handling approach for the supported spreadsheet workflow. OWASP discusses pitfalls with separators, quoting and escaping; ordinary CSV quoting alone shouldn't be treated as a universal solution. Handling considerations

Don't approve external-content requests or follow unexpected links merely because the file came through your own form. The form is receiving other people's input. Treat the source of that input separately from the familiar export button.

Define which fields should remain literal text and test them with harmless examples in a copy. Preserve the original responses so an attempted fix doesn't silently change what someone submitted.

Include legitimate punctuation and text that resembles a calculation in those checks. Deleting every awkward character could make a safer-looking export by corrupting the response. The goal is literal interpretation in the intended workflow, not a record that has lost its meaning.

Join the discussion

More in Technology