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.
- 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:
- Create a project.
- Go to
http(s)://{GitLab Host}/{userid}/{Project Name}/labels/new. - Fill out
Titleform withPoC. - Click
Create labelbutton. - Intercept the request.
- Change the value of the parameter of
label%5Bcolor%5Dto#0...(50000 times)c0ffee. - 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.
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
- Create a project.
- Go to the new label page for the project.
- Fill in the title field with 'PoC'.
- Click the 'Create label' button.
- Intercept the request.
- 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.