Reporters can download corpus files from projects: gitlab.com/<NameSpace>/<ProjectName>/-/package_files/<>/download
A permission check was missing on the corpus file download endpoint, so a user with only the Reporter role could fetch corpus files that should be limited to Developer and above. An attacker with a low-privilege account could download these files by guessing the numeric file identifier.
GitLab
Originally disclosed on GitLab
- Fixed in 10 months
- Disclosed after 10 months
HackerOne report #1485798 by ashish_r_padelkar on 2022-02-19, assigned to @ankelly:
Report
Report
Summary
Hello,
Corpus management feature is available for users with Developer and higher roles at https://gitlab.com/<NameSpace>/<ProjectName>/-/security/configuration/corpus_management.
There is a missing permission check here which allows user with Reporter role to download the corpus file uploaded in corpus management.
Steps to reproduce
- As an admin, Go to
https://gitlab.com/<NameSpace>/<ProjectName>/-/security/configuration/corpus_managementand create a new corpus. - Now login as reporter in same project and browse
https://gitlab.com/<NameSpace>/<ProjectName>/-/security/configuration/corpus_managementbut you will get404page as you dont have access to this feature. - Now directly use the url
https://gitlab.com/<NameSpace>/<ProjectName>/-/package_files/29539786/downloadto download the corpus file uploaded in step1. It will successfully download.
You need to brute force the ID in above url which is possible as its numeric.
For easy reproduction steps, directly copy the download url from admin account and then browse it using reporter role.
What is the current bug behavior?
Reporter users can download corpus files which are normally available for developer and above roles
What is the expected correct behavior?
Downloading corpus files should be restricted only for developer and above roles
Output of checks
This bug happens on GitLab.com
Regards,
Ashish
Impact
Reporters can download corpus files from projects
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 file download endpoint did not verify that the requesting user had Developer or higher access to the project before serving the corpus file.
Impact
A Reporter-level user could download corpus files that are meant to be restricted to Developer and above roles, though the numeric identifier must be guessed.
What the attacker needed
A Reporter role in the project; a corpus file already uploaded; guessing the numeric file ID
How it was found
- As an admin, open the corpus management page and create a new corpus.
- Log in as a Reporter on the same project and open the corpus management page, which returns a 404.
- Open the package file download URL directly to download the corpus file.
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 projects give people different roles, and a Reporter is a fairly low role that should not see certain security settings. The page for managing corpus files correctly blocked Reporters, but the separate download link for those files did not check the role at all. So a low-privilege user could still grab the file by opening its download address directly.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.