DoS Too long file name causes various impact.
Adding a file with an extremely long filename to a GitLab project caused the existing README.md to be deleted and made the new file unviewable and undeletable, and also prevented the project from being cloned. An attacker with a normal account could therefore damage a project's availability and integrity.
GitLab
Originally disclosed on GitLab
- Fixed in 4.1 years
- Disclosed after 4.1 years
Link: https://hackerone.com/reports/413117
By: @8ayac
Details: Summary: I have discovered various impact caused by adding files whose file names are too long to the project, which violates the Availability and Integrity of the system.
Description: Adding a file whose filename is too long to the projects has several impact. Among them, the most interesting thing is deleting a certain file. The target is the file added to the project first.
Steps To Reproduce:
- Sign in to GitLab.
- Go to "http(s)://{GitLab host}/projects/new"
- Fill out "Project name" form with "testProject".
- Check the check box of "Initialize repository with a README.md".
- Click "Create project" button.
- Go to "http(s)://{GitLab host}/{user id}/testProject/new/master".
- Fill out "File name" form with 'A'*100000 (Generate it with the following command:
$ python -c "print('A'*100000')). - Click "Commit changes" button.
Result: README.md was deleted from the project.
Supporting Material
I attached a movie.
Impact
The impact is not limited to the above, there are several. Those I have confirmed are as follows:
- Deletion of the certain file from project. (as above)
- Content of the file added in steps 7 to 8 above can not be viewed. (If the file added is not empty.)
- There is no way for the user to delete the added file. (The server returns "414 Request - URI Too Large".)
- The user can't
git clonethe project.
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 does not validate or limit filename length, so an oversized name breaks file handling and URL-based operations on the repository.
Impact
The attacker could delete an existing file, make the new file unviewable and undeletable, and prevent the project from being cloned, harming availability and integrity.
What the attacker needed
A GitLab account; ability to create a project
How it was found
- Sign in to GitLab and start creating a new project.
- Name the project and initialise it with a README.md.
- Open the page for adding a new file to the repository.
- Enter an extremely long filename and commit the change.
- Observe that README.md has been deleted from the project.
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.
GitLab lets you create files in a project through the web page. If you give a file an absurdly long name, the server mishandles it: an existing file disappears, the new file cannot be opened or removed, and the whole project can no longer be downloaded. This means someone with a normal account can break a project for everyone else.
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.