The product saves user-provided information into a Comma-Separated Value (CSV) file, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as a command when the file is opened by a spreadsheet product.
User-provided data is often saved to traditional databases. This data can be exported to a CSV file, which allows users to read the data using spreadsheet software such as Excel, Numbers, or Calc. This software interprets entries beginning with '=' as formulas, which are then executed by the spreadsheet software. The software's formula language often allows methods to access hyperlinks or the local command line, and frequently allows enough characters to invoke an entire script. Attackers can populate data fields which, when saved to a CSV file, may attempt information exfiltration or other malicious activity when automatically executed by the spreadsheet software.
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
CVE: CVE-2019-12134
Low privileged user can trigger CSV injection through a contact form field value
CVE: CVE-2019-4521
Cloud management product allows arbitrary command execution via CSV injection
CVE: CVE-2019-17661
CSV injection in content management system via formula code in a first or last name
N/A
N/A
Phase | Note |
---|---|
Implementation | The weakness is in the implementation of a software's CSV export feature, in particular how it formats formula entries as the output gets flattened into a text file. |
Intro: Hyperlinks or other commands can be executed when a cell begins with the formula identifier, '='
Body: Stripping the leading equals sign, or simply not executing formulas from untrusted sources, impedes malicious activity.
=HYPERLINK(link_location, [friendly_name])