Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CsvOutputFormatter does not mitigate agains Spreadsheet Formula Injection #151

Open
@crittag

Description

As CSV files from web applications are frequently downloaded and then opened in Excel (or similar), consideration should be made for the possibility of Formula Injection (see here)

Mitigation would be to prefix with a single quote (') character wherever a value starts with equals ("="), plus ("+"), minus ("-"), at ("@") or percentage ("%") character

Suggest:
if (_val.Length > 0 && (new string[]{"=", "+". "-", "@", "%"}).Contains(_val.Substring(0,1)) _val = "'" + _val;

May be worth adding a boolean value (default true) to the CsvFormatterOptions to control this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /