Skip to content
RCE Disclosed report Beginner

CSV Excel Macro Injection Vulnerability in export list of current users - app.shopify.com

The CSV export of installed users did not escape field values, so a shop name containing a spreadsheet formula would be written into the file as a live formula. An attacker could set a malicious shop name and, when a partner opened the exported file in a spreadsheet application, the formula could run a command on the partner's computer.

Mahmoud Gamal Follow

Originally disclosed on HackerOne

  • Triaged in 5 hours
  • Fixed in 11 days
  • Disclosed after 11 days

Summary by the program

A CSV formula injection issue when a Partner export the list of current users for one of their application.

The report

Hi , I have found that when a user tries to Export list of current users who installed his apps through: https://app.shopify.com/services/partners/api_clients/<app_id>/export_installed_users the fields of the CSV file are not properly escaped. which makes them vulnerable to CSV Excel Macro Injection. #Scenario: An attacker could change his shop name to a malicious function that executes malware on the user's PC. Since functions aren't escaped, the possibilities of using this can be limitless and can cause a severe impact. One example is having it execute malware on the user computer. #Steps to reproduce:

  1. Login to your partner account then go to https://app.shopify.com/services/partners/api_clients and create a new app.
  2. Go to <your_store>.myshopify.com/admin/oauth/authorize?client_id=<app_api_key>&redirect_uri=<app_redirect_uri>&response_type=code&scope=read_products%2Cwrite_products                     

where The <app_api_key> is the api key of the app you have created through the partner account and the <app_redirect_uri> is the redirect url of it. 3. Now click Install app 4. Go to <your_store>.myshopify.com/admin/settings and change the store name to -2+3+cmd|' /C calc'!D2 5. Go to https://app.shopify.com/services/partners/api_clients/<app_id>/ then scroll down and click the Export list of current users button . then A CSV file will be sent to your email , open that file and you'll see that the cell is active and the command will be executed.

####References:

Thanks

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the export wrote user-controlled field values into the CSV without neutralising leading formula characters, so spreadsheet software interpreted them as formulas.

Impact

An attacker could cause a partner who opens the exported file in a spreadsheet application to run an arbitrary command, potentially installing malware on the partner's computer.

What the attacker needed

A partner account; an app installed on a store; control of a store name; victim opens the CSV in a spreadsheet

How it was found

  1. Log in to the partner account and create a new app.
  2. Install the app on a store using the authorisation link with the app's API key and redirect URI.
  3. Change the store name to a value that looks like a spreadsheet formula.
  4. Open the partner app page and click the export button for current users.
  5. Open the CSV file that arrives by email and observe that the cell is active and the command runs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a website exports data to a CSV file (a plain text table that spreadsheet programs open), it should make sure any text starting with a formula character is treated as text, not as a formula. Here it did not, so a shop name that looks like a formula stayed a formula. If a partner opened the export in a spreadsheet program, that formula could run a command on their machine.

What is RCE?

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

More by Mahmoud Gamal

View all

32 more disclosed reports, best first.

More from Shopify

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.