Skip to content
DoS Disclosed report Intermediate

All functions that allow users to specify color code are vulnerable to ReDoS

The colour validation regex in GitLab is vulnerable to catastrophic backtracking, allowing an attacker to send a crafted colour value that causes excessive CPU usage and a denial of service. By continuously sending such requests, the attacker can keep the service unavailable.

8ayac Follow

Originally disclosed on HackerOne

Bounty$1,000 Low View original
  • Triaged in 16 days
  • Fixed in 4 months
  • Paid in 4 months
  • Disclosed after 5 months

Summary: Invalid color code leads to DoS.

Description: GitLab has some functions that allow users to specify color code. (e.g.: Labels/Broadcast Messages) All those functions are vulnerable to ReDoS. It seems that there is a problem with the regex in app\validators\color_validator.rb to validate a specified color code. An attacker can exhaust the server's CPU with this vulnerability, and cause a continuous DoS.

Steps To Reproduce:

  1. Create a project.
  2. Go to http(s)://{GitLab Host}/{userid}/{Project Name}/labels/new.
  3. Fill out Title form with PoC.
  4. Click Create label button.
  5. Intercept the request.
  6. Change the value of the parameter of label%5Bcolor%5D to #0...(50000 times)c0ffee.
  7. Forward the request.

Result: Can not access to GitLab service. (CPU usage rate of the server had risen to over 90%.)

Note: If the attacker sends requests continuously, DoS will be continuous.

Supporting Material/References:

Regular expression Denial of Service - ReDoS - OWASP

Impact

All users will not be able to access the entire GitLab service.

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

Impact

All users could be unable to access the entire GitLab service, and continuous requests can cause a continuous denial of service.

What the attacker needed

A GitLab account; ability to create a project; ability to intercept HTTP requests

How it was found

  1. Create a project.
  2. Go to the new label page for the project.
  3. Fill in the title field with 'PoC'.
  4. Click the 'Create label' button.
  5. Intercept the request.
  6. Change the label colour parameter to a very long invalid value and forward the request.

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 regular expression is a pattern used to check text. Some patterns can take a very long time to fail on certain inputs, using lots of computer power. Here, a specially crafted colour code makes the server's pattern matching work extremely hard, slowing down or stopping the whole service.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by 8ayac

View all

5 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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.