Skip to content
Access control Disclosed report Beginner

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

  1. Login as project maintainer and lock any file.
  2. Login as a developer and go to the locked file. You will still see EDIT option in the file although file is locked.
  3. If you try to EDIT the content, you will see a error saying file has been already locked by another user.
  4. Now just EDIT the name of the file without changing anything.
  5. File will be renamed successfully and lock is released.
  6. 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

The original report as published on GitLab. Images and videos are our own copies; raw HTML is shown as text. View it on GitLab.

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

  1. Log in as a project maintainer and lock a file.
  2. Log in as a developer and open the locked file; the edit option is still shown.
  3. Try to edit the content and see an error that the file is locked by another user.
  4. Edit the file name without changing anything else.
  5. The file is renamed and the lock is released.
  6. 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.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.