Developers can EDIT names of locked files which are locked by other users
A user with the Developer role could rename a file that another user had locked, even though the lock should prevent edits. Renaming the file released the lock and made the original file disappear from the interface.
GitLab
Originally disclosed on GitLab
- Fixed in 4 months
- Disclosed after 4 months
HackerOne report #746601 by ashish_r_padelkar on 2019-11-26, assigned to @ankelly:
Summary
Hello,
As per https://docs.gitlab.com/ee/user/project/file_lock.html , You can unlock a file that yourself or someone else previously locked as long as you have Maintainer or above permissions to the project..
However, A user with Developer role can still EDIT locked files of other users in the projects. They are not able to EDIT the contents of the file but able to change the file name. After renaming the locked file, the old file is not visible anywhere and the newly updated files locked is released automatically.
Steps to reproduce
- Login as project maintainer and lock any file.
- Login as a developer and go to the locked file. You will still see
EDIToption in the file although file is locked. - If you try to EDIT the content, you will see a error saying file has been already locked by another user.
- Now just EDIT the name of the file without changing anything.
- File will be renamed successfully and lock is released.
- Maintainers wont find a old file anywhere in the UI.
What is the current bug behavior?
A Developer can EDIT locked file names which eventually releases the lock on the file
What is the expected correct behavior?
Developer shouldnt be allowed to EDIT the locked file names
Output of checks
This bug happens on GitLab.com and might be on omnibus installations too. I tested this on gitlab.com
Regards,
Ashish
Impact
Developer users can EDIT locked file names which are locked by other users
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 rename action did not check whether the file was locked by another user, only the content edit action did.
Impact
A developer could rename a locked file, which released the lock and hid the original file from maintainers, undermining the file lock feature.
What the attacker needed
A GitLab account with Developer role; a file locked by another user
How it was found
- Log in as a project maintainer and lock a file.
- Log in as a developer and open the locked file; the edit option is still shown.
- Try to edit the content and see an error that the file is locked by another user.
- Edit the file name without changing anything else.
- The file is renamed and the lock is released.
- The original file is no longer visible in the interface.
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 lock a file so that only certain people can change it. A user with lower permissions found they could still change the file's name, which also removed the lock. This meant the lock did not fully protect the file.
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.