Read more

Advisory: Excel converts CSV entries to formulas

Tobias Kraze
October 10, 2017Software engineer at makandra GmbH

If your application exports CSV, be advised that Excel and other spreadsheet applications treat certain cells (those starting with =, +, - or @) as formulas.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

This is an issue if you output user input. Not only is it probably not what you want, it also poses a security risk. See the link for attack vectors.

Note that current Excel versions will warn the user when opening the file. At least for the code execution vulnerability, these three warnings seems adequate to me.

Code execution warnings:

Image

Image

Image

External links:

Image

Solution

If possible, always try to avoid CSV and output XLS(X) files directly as this does not suffer from this issue and has other advantages as well.

Posted by Tobias Kraze to makandra dev (2017-10-10 13:54)