Client-side DOS by viewing a large source file
Viewing a large source file on GitLab.com causes excessive client-side CPU consumption, making the page unresponsive and eventually reloaded by the browser. An attacker could upload such a file to a repository, and a victim viewing it would experience a denial of service.
GitLab
Originally disclosed on GitLab
- Fixed in 6 months
- Disclosed after 6 months
⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.
HackerOne report #2584294 by a92847865 on 2024-07-02, assigned to @greg:
Report | Attachments | How To Reproduce
Report
NOTE! Thanks for submitting a report! Please note that initial triage is handled by HackerOne staff. They are identified with a
HackerOne triagebadge and will escalate to the GitLab team any. Please replace all the (parenthesized) sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!
Summary
Viewing a large source file on Gitlab.com can cause excessive CPU time consumption on client-side (browser) --> unresponsive Gitlab.com UI --> stopped or reloaded by browsers.
Steps to reproduce
(Step-by-step guide to reproduce the issue, including:)
- Create a test repository on Gitlab.com
- Upload to that test repo.
- Click to view
package.rbfile. - After some seconds, Gitlab.com page is totally unresponsive.
We can also use monitoring to know which process is consuming excessive CPU time . On Safari, the process is named Gitlab.com. On Google Chrome, it's the Chrome helper process.
Note: Attacker can add normal code at the beginning of the file to make it more difficult for users to aware about the exploit.
Impact
Viewing a large source file on Gitlab.com can make Gitlab.com page unresponsive --> being reloaded by browser.
Examples
(If the bug is project related, please create an example project and export it using the project export feature)
(If you are using an older version of GitLab, this will also help determine whether the bug has been fixed in a more recent version)
(If the bug can be reproduced on GitLab.com without violating the Rules of Engagement as outlined in the program policy, please provide the full path to the project.)
What is the current bug behavior?
Gitlab.com parses and shows big (some MB) source files directly --> excessive CPU time consumption on client-side.
What is the expected correct behavior?
Gitlab.com should limit the size of source files being parsed and presented on client-side.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info)
(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)
Impact
Client-side DOS: Viewing a large source file on Gitlab.com can make Gitlab.com page unresponsive --> being reloaded by browser.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
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, GitLab.com does not limit the size of source files that it parses and renders on the client side, leading to excessive CPU usage.
Impact
Viewing a large source file on GitLab.com can make the page unresponsive and cause the browser to reload it, resulting in a client-side denial of service.
What the attacker needed
Victim views the large file
The fix
GitLab.com should limit the size of source files that are parsed and presented on the client side.
How it was found
- Create a test repository on GitLab.com.
- Upload a large source file (package.rb) to the repository.
- Click to view the package.rb file.
- After some seconds, the GitLab.com page becomes totally unresponsive.
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 you open a file on a website, your browser has to process the file's contents. If the file is very large, the browser can use so much processing power that the page freezes and may be reloaded. This report shows that GitLab.com does not limit the size of files it tries to display, so a huge file can make the page unresponsive for anyone who views it.
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.