GraphQL mutations allow Merge Request creator to bypass locked status
The GraphQL mutation discussionToggleResolve did not check whether a merge request was locked, so a merge request creator could still resolve or unresolve discussion threads after the repository owner locked the MR. An attacker could perform state-changing actions on a locked merge request.
GitLab
Originally disclosed on GitLab
- Fixed in 10 months
- Disclosed after 10 months
HackerOne report #1063420 by jimeno on 2020-12-21, assigned to @dcouture:
Report | Attachments | How To Reproduce
Report
Summary
Hi GitLab,
I'd like to report an Improper Access Control issue where attacker is able to perform state changing actions such as (un-)resolving discussion threads in Merge Requests after the repository owner locks the MR. The mutation used in this example is discussionToggleResolve.
Scenario setup
-
Victim: create a public repository and add a dummy file to it
-
Attacker: fork the project and add a change to it
-
Attacker: submit a Merge Request
-
Any: add a comment so a discussion thread is generated
-
Victim: lock the Merge Request (notice the attacker isn't able to (un-)resolve the existing discussions anymore)

setup_final_status.png From the original on GitLab
Steps to reproduce
-
Attacker: notice you aren't able to post new comments or resolve the discussion thread via the user interface

attacker_opens_locked_mr.png From the original on GitLab -
Attacker: run the following GraphQL query to find the ID of the discussion thread. Please, replace the repo and owner where needed
GraphQL { project(fullPath: "naaytesting/bugbountydemo") { mergeRequests { edges { node { id title discussions { edges { node { id resolvable notes { edges { node { body } } } } } } } } } } } -
Attacker: note the discussion ID. In my case it is
gid://gitlab/DiffDiscussion/da18f8200f0934b43fd1d1f62d5ea1a8dec2e1a8. Notice itsresolvableattribute is set totruewhile the UI shows the MR is completely locked and doesn't allow to (un-)resolve it. -
Run the following GraphQL query replacing the ID with yours.
GraphQL mutation test { discussionToggleResolve(input: {id: "gid://gitlab/DiffDiscussion/da18f8200f0934b43fd1d1f62d5ea1a8dec2e1a8", resolve: true}) { errors } } -
Victim: refresh the MR and notice the attacker was able to perform activities against it and the discussion is resolved now.

attacker_activity_in_pr_after_locking.png From the original on GitLab
Impact
Attacker is able to do state-changing actions against a locked MR. In this particular case, (un-)resolve discussion threads.
Examples
GitLab.com users can perform state-changing actions in their Merge Requests after the repository owners have locked them.
What is the current bug behavior?
Attacker is able to do state-changing actions against a locked MR. In this particular case, (un-)resolve discussion threads.
What is the expected correct behavior?
Attacker isn't able to do state-changing actions after the repo owner locks their MR.
Relevant logs and/or screenshots
Please, refer to each section.
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
N/A
Impact
Attacker is able to do state-changing actions against a locked MR. In this particular case, (un-)resolve discussion threads.
If this is the expected behavior, please let me know and I'll be happy to self-close this report as N/A.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
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 GraphQL mutation for toggling discussion resolution did not enforce the merge request's locked status, unlike the web interface.
What the attacker needed
Public repository; attacker can fork and submit MR; victim locks the MR
How it was found
- Victim creates a public repository and adds a dummy file.
- Attacker forks the project and adds a change.
- Attacker submits a merge request.
- Any user adds a comment to create a discussion thread.
- Victim locks the merge request.
- Attacker uses a GraphQL query to find the discussion ID and then runs a mutation to resolve it.
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.
A merge request is a way to propose changes to a project. When the owner locks it, they expect no one to be able to change anything, like commenting or resolving discussions. But the attacker found that a specific action (resolving a discussion) could still be done through a different interface, the GraphQL API, even though the normal web interface blocked it.
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.