# Feature OP-19425 - Escape possible control characters in CSV export

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-19425

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 17.6.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | DevSecOps / Security, Modules and project features / Export |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers | Oliver Günther |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** an adminstrator of OpenProject  
**I want to** be able to restrict the export of CSV with control characters  
**so that** users have to think less about security when dealing with these files

**Acceptance criteria**

*   Add global settings page &quot;Exports&quot;
    
    *   Move work\_packages\_projects\_export\_limit setting into it
        
    *   Add new setting &quot;Escape control characters in CSV&quot;
        
    *   This setting is on by default
        
*   If enabled, the setting will escape leading &nbsp;`= @ \t \r` characters, and leading `- +` escaped unless this number is deliberately exported as a number/currency (-5.00, -1.234,56 €
    
*   Note: There is no official mitigation for CSV exports, so this setting will modify the export
    
    *   The technique we implement is noted by OWASP as one that may not survive Excel save-and-reopen.
        
    *   There are alternatives to this (e.g., entering a tab character at the beginning), but this will be more disruptive
        

**Technical notes**

*   <br>
    

**References**

*   https://owasp.org/www-project-web-security-testing-guide/latest/4-Web\_Application\_Security\_Testing/07-Input\_Validation\_Testing/21-Testing\_for\_CSV\_Injection
    

**Credits**

This feature was the result of a security report with help from the following SHA club members.

*   [**@QwQP0**](https://github.com/QwQP0) - Finder / Analyst: helped identify and validate the CSV formula injection attack surface.
    
*   [**@dkstjwls06**](https://github.com/dkstjwls06) - Analyst: helped review the impact and reproduction evidence.
    
*   [**@minnnjuuu**](https://github.com/minnnjuuu) - Analyst: helped verify the OpenProject export behavior.
