Skip to content
RCE Disclosed report Beginner

CSV injection in gitlab.com via issues export feature.

GitLab's issue export to CSV did not neutralise spreadsheet formula characters in issue titles, so a crafted title could run a command when the file was opened in a spreadsheet on Windows. An attacker could execute code on a victim's machine or exfiltrate data.

edoverflow Follow

Originally disclosed on HackerOne

Medium 6.5 View original
  • Triaged in 3 days
  • Fixed in 4 months
  • Disclosed after 4 months

Dear GitLab bug bounty team,

Summary


GitLab allows users to export issues as a .csv file. By injecting a payload into an issue title an attacker could exfiltrate data or execute code on the target machine. For instance, by naming an issue =cmd|' /C calc'!A0 I am able to open up calc.exe on Windows.

Steps to reproduce


  1. Create an issue with =cmd|' /C calc'!A0 as the title;
  2. Export all issues (The file is sent as an email attachment);
  3. Open the .csv file on a Windows machine.

Result: calc.exe pops up.

Fix


Prefix =, +, - and @ symbols with a ' in issues when exporting them to a .csv file.

If you require any further information, feel free to contact me.

Best regards, Ed

The original report as published on HackerOne, by edoverflow. 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

The export wrote user-controlled issue titles into CSV cells without escaping leading formula characters, so spreadsheet software interpreted them as formulas.

Impact

Opening the exported file on Windows could execute a command on the victim's machine, and the report also claims data exfiltration is possible.

What the attacker needed

Ability to create an issue; victim exports issues to CSV; victim opens the file in a spreadsheet on Windows

How it was found

  1. Create an issue whose title begins with a spreadsheet formula.
  2. Export all issues; the file is delivered as an email attachment.
  3. Open the exported CSV on a Windows machine.

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.

A CSV file is a plain-text table that spreadsheet programs open. Some spreadsheets treat a cell starting with =, +, - or @ as a formula and run it. Because GitLab copied issue titles into the file without escaping those characters, a malicious title became a live formula on the victim's computer.

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 edoverflow

View all

27 more disclosed reports, best first.

More from GitLab

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.