Skip to content
RCE Disclosed report Beginner

Formula injection via CSV exports in WordCamp Talks plugin

The plugin does not sanitise CSV exports, so a talk title starting with a formula character is treated as a formula when the CSV is opened in a spreadsheet, and commands could be run if the user enables external content.

whitehatter Follow

Originally disclosed on HackerOne

Bounty$50 Medium 4.6 View original
  • Fixed in 5 days
  • Paid in 5 days
  • Disclosed after 8 days

The WordCamp Talks plugin does not attempt to sanitize CSV exports, which can lead to spreadsheet formula injection via malicious inputs.

POC

  • Submit a new talk with the title of =1+1.
  • Visit the All Talks page (/wp-admin/edit.php?post_type=talks)
  • Click the CSV Export link
  • Open the downloaded file in Excel, Numbers, or similar
  • Note that the talk's title is displayed as 2, showing the title was imported as a formula.

Impact

Excel allows external commands to be executed via formulas after a warning prompt. The warning says "Do not enable this content unless you trust the source of this file", but since most users do trust the source (their WordCamp site), they may be more likely to allow it.

Lots of arbitrary commands can be executed this way, including installing other commands in a way that can bypass antivirus scanning.

More details can be found at https://pentestmag.com/formula-injection/

Remedy

wct_generate_csv_content() needs to ensure that the first character in each value is not one of =, -, or +. These can come from several columns such as the title, categories, and tags, so all data should be sanitized.

Further info:

https://www.owasp.org/index.php/CSV_Excel_Macro_Injection https://hackerone.com/reports/72785

The original report as published on HackerOne, by whitehatter. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

WordCamp Talks is a WordPress plugin that adds a custom post type for conference talks. Talks are managed from the WordPress admin, and the plugin provides a CSV export so that site administrators can pull the list of submitted talks out of the dashboard and into a spreadsheet. The export is produced by a function called wct_generate_csv_content().

The report concerns that export path: the plugin writes talk data into a CSV file without sanitising it, so values that begin with a spreadsheet formula character are written through unchanged and are later interpreted as formulas when the file is opened in a spreadsheet application.

Setup

No special accounts, tools or versions are described. The precondition is simply the ability to submit a talk whose title is attacker-controlled, plus an administrator who exports the talks list and opens the resulting file in Excel, Numbers or a similar application.

Finding it

The plugin does not attempt to sanitise CSV exports. Formula characters can come from several columns such as the title, categories and tags, so all data should be sanitised. That mismatch between what the plugin treats as plain text and what the spreadsheet treats as executable content is the bug.

Exploitation

Step 1: submit a talk with a formula as its title

Create a new talk and set the title to:

The leading = is what makes a spreadsheet application treat the cell as a formula rather than a literal string. The talk is submitted with the title set to the formula.

Step 2: open the All Talks page

Visit the talks list in the WordPress admin:

Text
/wp-admin/edit.php?post_type=talks

This is the standard custom post type listing for the talks post type, and it is where the export link lives.

Step 3: export the CSV

Click the CSV Export link on that page. Click the CSV Export link on that page to download the file.

Step 4: open the file in a spreadsheet application

Open the downloaded file in Excel, Numbers or similar. The talk's title is displayed as:

That result shows the title was imported as a formula and evaluated, rather than shown as the text =1+1.

Root cause

wct_generate_csv_content() needs to ensure that the first character in each value is not one of =, - or +. A cell whose content begins with =, - or + is interpreted by spreadsheet software as a formula. Because the plugin passes user-controlled data straight into the CSV, the spreadsheet, not the plugin, decides what the value means.

The same exposure applies to several columns, not just the title: categories and tags are also user-influenced, so all exported data needs the same treatment.

Impact

Excel allows external commands to be executed via formulas, but only after a warning prompt. The warning reads "Do not enable this content unless you trust the source of this file". The researcher's point is that most users do trust the source, since it is their own WordCamp site, so they may be more likely to allow the content.

Lots of arbitrary commands can be executed this way, including installing other commands in a way that can bypass antivirus scanning. The attack targets the user who exports and opens the file, who may be more likely to allow the content.

Fix

Since these characters can arrive through several columns such as the title, categories and tags, all data should be sanitised, not just the title.

The report points to further references, including the OWASP CSV Excel Macro Injection page and a HackerOne report.

Variants to test

  1. A positive result is the cell evaluating rather than displaying the literal text.
  2. Try the same payload in categories and tags, not only the title, since the report names those columns as additional sources. A positive result is the formula evaluating from one of those columns in the exported file.
  3. A positive result is any column where the leading character survives into the CSV and is evaluated on open.

Hunting notes

The researcher demonstrated impact with a minimal payload, =1+1, and a visible result, the title rendering as 2. That is enough to show the value was evaluated as a formula, and the report ties it to command execution after a warning prompt that users of their own site may be more likely to allow.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

What happened, in plain words

A WordPress plugin called WordCamp Talks lets a site collect conference talk submissions and then export the list of talks as a CSV file. CSV stands for comma-separated values: a plain text file where each line is a row and commas separate the columns, which spreadsheet programs like Excel or Numbers can open as a table. The plugin builds that file with a function called wct_generate_csv_content().

The problem is that the plugin copies whatever people typed into the talk fields straight into the CSV file without checking it. Spreadsheet programs treat any cell that starts with certain characters, such as =, as a formula to calculate rather than as text to display. So if someone submits a talk whose title starts with =, the plugin saves it as ordinary text, but when an administrator exports the talks and opens the file, the spreadsheet runs the title as a formula.

This kind of bug is called formula injection, or CSV injection. The everyday comparison: imagine a form where you write a note, and a clerk copies your note word for word onto a sheet of paper. The plugin is the clerk; the spreadsheet is the accountant.

Context

WordCamp Talks is a WordPress plugin. WordPress is a popular system for building websites, and a plugin is an add-on that gives the site extra features. This plugin adds a custom post type for conference talks. A post type is WordPress's way of grouping similar content: ordinary blog posts are one type, pages are another, and this plugin adds a type called talks so that each submitted talk is stored as its own entry.

Talks are managed from the WordPress admin, the password-protected back office where site staff create and edit content. The plugin also provides a CSV export, a button that produces a downloadable file containing the list of submitted talks, so an administrator can pull the data out of the dashboard and into a spreadsheet for review or reporting. The export is produced by the function wct_generate_csv_content().

The report concerns that export path. The plugin writes talk data into a CSV file without sanitising it. Sanitising means cleaning input so that characters with special meaning are neutralised or escaped. Because nothing is cleaned, values that begin with a spreadsheet formula character are written through unchanged and are later interpreted as formulas when the file is opened in a spreadsheet application.

Setup

No special accounts, tools or versions are described. The precondition is simply the ability to submit a talk whose title is attacker-controlled, plus an administrator who exports the talks list and opens the resulting file in Excel, Numbers or a similar application. The attacker needs to be able to submit a talk, and the victim is the administrator who later exports and opens the file.

Finding it

The researcher noticed that the plugin does not attempt to sanitise CSV exports. Formula characters can come from several columns such as the title, categories and tags, so all data should be sanitised. That mismatch between what the plugin treats as plain text and what the spreadsheet treats as executable content is the bug.

To unpack that: the plugin thinks a title is just a label. The spreadsheet thinks a cell starting with = is an instruction. Neither side is wrong on its own, but together they let a visitor's text become a formula in the administrator's spreadsheet.

Exploitation

Step 1: submit a talk with a formula as its title

Create a new talk and set the title to:

The leading = is what makes a spreadsheet application treat the cell as a formula rather than a literal string. The talk is submitted with the title set to the formula. The attacker is not trying to break anything at this stage; they are simply planting a value that will mean something different to the spreadsheet later.

Step 2: open the All Talks page

Visit the talks list in the WordPress admin:

Text
/wp-admin/edit.php?post_type=talks

This is the standard custom post type listing for the talks post type, and it is where the export link lives. Breaking the address down: /wp-admin/ is the admin area, edit.php is the WordPress screen that lists entries, and ?post_type=talks tells it which type of entry to list. The researcher goes here because this is the page an administrator would use to start the export.

Step 3: export the CSV

Click the CSV Export link on that page. Click the CSV Export link on that page to download the file.

Step 4: open the file in a spreadsheet application

Open the downloaded file in Excel, Numbers or similar. The talk's title is displayed as:

That result shows the title was imported as a formula and evaluated, rather than shown as the text =1+1. The spreadsheet saw the =, calculated one plus one, and displayed the answer. Seeing 2 where the text should be is the proof that the value was treated as code, not as a label.

Root cause

wct_generate_csv_content() needs to ensure that the first character in each value is not one of =, - or +. A cell whose content begins with =, - or + is interpreted by spreadsheet software as a formula. Because the plugin passes user-controlled data straight into the CSV, the spreadsheet, not the plugin, decides what the value means.

The same exposure applies to several columns, not just the title: categories and tags are also user-influenced, so all exported data needs the same treatment.

Impact

Excel allows external commands to be executed via formulas, but only after a warning prompt. The warning reads "Do not enable this content unless you trust the source of this file". The researcher's point is that most users do trust the source, since it is their own WordCamp site, so they may be more likely to allow the content.

Lots of arbitrary commands can be executed this way, including installing other commands in a way that can bypass antivirus scanning. Arbitrary commands here means commands of the attacker's choosing, run on the administrator's machine. The attack targets the user who exports and opens the file, who may be more likely to allow the content.

Fix

Since these characters can arrive through several columns such as the title, categories and tags, all data should be sanitised, not just the title.

The report points to further references, including the OWASP CSV Excel Macro Injection page and a HackerOne report.

Variants to test

  1. A positive result is the cell evaluating rather than displaying the literal text.
  2. Try the same payload in categories and tags, not only the title, since the report names those columns as additional sources. A positive result is the formula evaluating from one of those columns in the exported file.
  3. A positive result is any column where the leading character survives into the CSV and is evaluated on open.

Hunting notes

Recon means the early survey of a site to see what features exist and where they might be weak.

The researcher demonstrated impact with a minimal payload, =1+1, and a visible result, the title rendering as 2. That is enough to show the value was evaluated as a formula, and the report ties it to command execution after a warning prompt that users of their own site may be more likely to allow.

Glossary

  • CSV: comma-separated values, a plain text file format where each line is a row and commas separate columns, openable in spreadsheet programs.
  • Plugin: an add-on that adds features to a WordPress site.
  • WordPress: a popular system for building and managing websites.
  • Custom post type: a WordPress grouping of similar content, such as blog posts, pages or, here, talks.
  • Admin: the password-protected back office of a WordPress site where staff manage content.
  • Function: a named block of code that performs a task, here wct_generate_csv_content().
  • Sanitising: cleaning input so characters with special meaning are neutralised or escaped.
  • Formula injection / CSV injection: a bug where user text starting with a formula character is written into a spreadsheet file and later run as a formula.
  • Payload: the value an attacker submits to trigger a bug, here =1+1.
  • Formula: an instruction in a spreadsheet cell, usually starting with =, that the program calculates.
  • Arbitrary commands: commands of the attacker's choosing, run on the victim's machine.
  • Antivirus: software that scans for and blocks malicious programs.
  • Recon: the early survey of a target to find features and possible weaknesses.
  • OWASP: an organisation that publishes guidance on web application security.

More by whitehatter

View all

3 more disclosed reports, best first.

More from Ian Dunn

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.