Today's episode is about functionality that can be used for phishing attacks.
It may be found on every website that allows for exporting data to CSV
format.
But how the text format can be used for the attack?
Excel is a spreadsheet created by Microsoft.
It provides a large number of built-in1 functions that simplify accounting.
![Excel functions list](https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=180 180w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=360 360w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=540 540w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=720 720w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=900 900w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=1080 1080w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=1296 1296w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=1512 1512w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=1728 1728w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=1944 1944w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=2160 2160w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=2376 2376w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=2592 2592w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=2808 2808w, https://img.szurek.eu/v7/_thumb_/3/8/5/385/funkcje.png?w=3024 3024w)
If we want to use a formula in a given cell instead of a number or text, we must start it with the equality sign.
Then the program knows that here the code should be executed.
For example, we can calculate the average of numbers from given cells.
In this way, you can also create a link to the external website.
![Hyperlink](https://img.szurek.eu/v7/_thumb_/3/8/5/385/hiperlacze.png?w={width})
Or you can execute an external program.
This functionality is called DDE. Its syntax is very simple:
=cmd|' /C calc'!A0
Microsoft realizes that this functionality can be used to execute dangerous code, so before launching it, it displays an appropriate message informing the user about potential consequences.
![Warning](https://img.szurek.eu/v7/_thumb_/3/8/5/385/ostrzezenie.png?w={width})
However, in reality many users keep allowing for the code execution because of habits or - ignorance.
In our case, the calculator was launched.
But how is it connect with the security of websites?
![Additional information](https://img.szurek.eu/v7/_thumb_/3/8/5/385/komunikat.png?w={width})
Let's assume that we are accountants and someone has sent us a link to the billing site, where we can download a list of transactions in CSV
format.
CSV is a data storage format, where the values are separated by a comma.
![CSV file format](https://img.szurek.eu/v7/_thumb_/3/8/5/385/csv.png?w={width})
These files can be opened by Excel - each value will be treated as a separate cell.
A bookkeeper may be surprised when a calculator suddenly pops up after opening a file.
If the calculator is launched, any malicious file may also be ran.
How did this happen? If file contains a value that begins with an equality sign, it will be treated as a formula and executed by Excel.
So, if we export any CSV files, it is worthwhile to precede all formulas with tabulation - they are then treated as ordinary text.
![Malicious file](https://img.szurek.eu/v7/_thumb_/3/8/5/385/csv_injection.png?w={width})
This vulnerability is called CSV Injection
but most companies don't consider it to be a security hole.
For example, Google does not pay for it as part of the Bug bounty2 program.
![Google bug bounty](https://img.szurek.eu/v7/_thumb_/3/8/5/385/google.png?w={width})
Why? Because the user controls the content of the exported file. In addition, the attacked client must confirm whether he wants to execute additional content.
However, it is good to have knowledge about such unusual solutions. There are many potential applications that can be attacked this way.
Here, an example from the AWS console3.
![Bug inside Amazon AWS console](https://img.szurek.eu/v7/_thumb_/3/8/5/385/amazon.png?w={width})
And that's all in this episode. As you can see, even a simple text format can be dangerous.