Skip to content
Access control Disclosed report Beginner

Non Member of Public Project Can Publish Drafted Reviews on Locked Merge Request

A non-member of a public project could publish a previously drafted review on a merge request even after the merge request was locked, bypassing the restriction that only project members can comment. This allowed the non-member to post comments on the locked merge request.

GitLab

Originally disclosed on GitLab

  • Fixed in 3 months
  • Disclosed after 3 months

HackerOne report #706044 by rafiem on 2019-10-02, assigned to @cmaxim:

Hi Team,

I have found improper access control on comment changes in merge request section. In the change section of merge request, user can make review, add comment and reply to comment to spesific line of code that changed. In case of submitting a review, user firstly create a draft of review, and then can finish review and submit review or add comment now. In the issue i found, when non members of public project previously created a pending draft review in one of the merge request, user still able to publish and submit the drafted review even if the merge request is locked by the members of the project. This violate the rule of locked merge request, that only project members can comment on all part of the spesific merge request.

Proof of Concept

1.) User A have a public project , example : https://gitlab.com/bajigur/cuk1
2.) User B and then make a draft review on one of the merge request in https://gitlab.com/bajigur/cuk1
3.) User A then set the merge request that User B make a draft review to Locked
4.) User B still able to submit and publish the drafted review that he previously make, that allow User B to comment to part of merge request, which is forbidden when merge request is locked

<>PoC Video Attached

PoC.webm From the original on GitLab

Impact

Non members still able to comment to merge reqeuest through darft review in changes even if merge request is locked

Best Regards,
@rafiem

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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 application does not re-check the merge request's locked status when a draft review is submitted, only when it is created.

Impact

Non-members could comment on a locked merge request, violating the intended access restriction.

What the attacker needed

Public project; non-member user; draft review created before lock

How it was found

  1. User A creates a public project.
  2. User B creates a draft review on a merge request in that project.
  3. User A locks the merge request.
  4. User B submits the previously drafted review, which gets published despite the lock.

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.

In GitLab, a merge request can be locked to prevent comments from non-members. However, if a non-member had already started a draft review before the lock, they could still submit it afterwards, effectively commenting on the locked merge request. This is an access control flaw because the lock should block all new comments from non-members.

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.