Skip to content
Business logic Disclosed report Beginner

MRs author can bypass merge requests approval rules and trick maintainers into accepting the MR

The merge request approval UI incorrectly showed 'merge request approved' when the MR author added themselves as an approver, even though no one had approved. An attacker could exploit this to trick maintainers into accepting an unapproved merge request.

GitLab

Originally disclosed on GitLab

  • Fixed in 50 days
  • Disclosed after 50 days

HackerOne report #953994 by vaib25vicky on 2020-08-08, assigned to @ngeorge1:

Hi,

In project settings merge requests approval rules is defined as

mr_aprv3.png
mr_aprv3.png From the original on GitLab

There is a bug in UI which displays merge request approved when MR author change the approver to himself. This doesn't happen if any user other than author is added as approver

mr_aprv2.png
mr_aprv2.png From the original on GitLab

The correct message should be like Requires approval from <name> which is displayed to other approvers but when author is the approver this is not happening.

mr_aprv1.png
mr_aprv1.png From the original on GitLab

Steps to reproduce

(Step-by-step guide to reproduce the issue, including:)

  • Create a test public project having settings
mr_aprv3.png
mr_aprv3.png From the original on GitLab
  • Login as other user who is not a member of the project
  • Creates a MR and in the approval rules edit the test
mr_aprv4.png
mr_aprv4.png From the original on GitLab
  • Delete the current approver and add a public group where you are the member
mr_aprv5.png
mr_aprv5.png From the original on GitLab
  • You'll see that merge request approved is displayed even though no one approve the MR
mr_aprv2.png
mr_aprv2.png From the original on GitLab

Impact

If maintainer has set that MR should be approve by security team before accepting then this bug can trick maintainers into accepting an unapproved MR in the project.

What is the current bug behavior?

The bug is displaying merge request is approved even when no one approve the MR

What is the expected correct behavior?

The correct behaviour should be Requires approval from <name> even when author make himself the approver

Output of checks

This bug happens on GitLab.com

Impact

MRs author can bypass merge requests approval rules and trick maintainers into accepting unapproved MR

Attachments

Warning: Attachments received through HackerOne, please exercise caution! [REDACTED]

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 UI logic for displaying approval status did not account for the case where the MR author is also an approver, incorrectly treating the author's own addition as an approval.

Impact

A maintainer could be tricked into accepting an unapproved merge request, bypassing the intended approval rules.

What the attacker needed

Public project with approval rules; attacker not a project member; attacker can create MR

How it was found

  1. Create a test public project with merge request approval rules set.
  2. Log in as a user who is not a member of the project.
  3. Create a merge request and edit the approval rule.
  4. Delete the current approver and add a public group where you are a member.
  5. Observe that 'merge request approved' is displayed even though no one approved the MR.

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, merge requests can require approval before they are merged. The interface wrongly displayed that the request was approved when the author made themselves the approver, even though no approval had actually happened. This could fool a maintainer into merging code that should have been checked.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.