Denial of service on repo settings via repo mirroring
An invalid URL entered in the repository mirror settings causes a server error that persists, making the repository settings page inaccessible to everyone. An attacker could permanently block access to the settings page for a project, and the invalid mirror cannot be removed through the interface.
GitLab
Originally disclosed on GitLab
- Fixed in 8 months
- Disclosed after 8 months
HackerOne report #667398 by xanbanx on 2019-08-05, assigned to jmatos_bgtvf:
Summary
I found a DOS vulnerability making the repository settings of a project unavailable. By crafting an invalid URL, the repository settings page becomes unavailable for everyone.
Steps to reproduce
- Create a repo
- Go to the repository settings page
- In the
Mirror a repositorysection add a new mirror repo with the url:https://ferrari-view.4me.it/view-share/playerp/?plContext=http://ferrari-%201363948628-stream.4mecloud.it/live/ferrari/ngrp:livegenita/manifest.f4m&cartellaConfig=http://ferrari-4me.weebo.it/static/player/config/&cartellaLingua=http://ferrari-4me.weebo.it/static/player/config/&poster=http://pusher.newvision.it:8080/resources/img1.jpg&urlSkin=http://ferrari-4me.weebo.it/static/player/swf/skin.swf?a=1363014732171&method=GET&target_url=http://ferrari-4me.weebo.it/static/player/swf/player.swf&userLanguage=IT&styleTextColor=#000000&autoPlay=true&bufferTime=2&isLive=true&highlightColor=#eb2323&gaTrackerList=UA-23603234-4 - This creates an immediate 500 error
However, the repository settings page is not accessible anymore and any further requests yield a 500 error again.
Impact
This is a DoS of the repository settings page. The problem here, is that the repo mirror cannot be deleted anymore, making the repo settings page inaccessible forever. The only way to remove the invalid mirror would using a direct access to the rails console or the database. This is of course not easy for public instances.
What is the current bug behavior?
After adding an invalid URL for the repo mirror the repo settings page becomes unavailable.
What is the expected correct behavior?
The app should reject invalid repo mirror urls.
Relevant logs and/or screenshots
bad URI(is not URI?): is raised in safe_urlapp/models/remote_mirror.rb:174. Either the URL needs to be encoded or the exception needs to be catched.
Impact
See above.
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 application did not validate or encode the mirror URL before parsing it, so an invalid URI raised an unhandled exception that broke the settings page.
Impact
The repository settings page becomes permanently unavailable, and the invalid mirror cannot be deleted through the interface, so only direct database or console access can fix it.
What the attacker needed
Access to repository settings; ability to add a mirror
The fix
The application should reject invalid repository mirror URLs, or catch the URI parsing exception.
How it was found
- Create a repository.
- Open the repository settings page.
- In the mirror section, add a new mirror with an invalid URL.
- The page immediately returns a 500 error and remains inaccessible.
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 repository mirror is a feature that copies another repository into yours. The application did not check that the address entered was a valid web address, so it crashed when trying to use it. Because the bad entry is saved, the settings page keeps crashing every time it is opened, and there is no button to remove the bad entry.
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.