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 online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
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)