Skip to content
Access control Disclosed report Intermediate

Attacker can post notes on private MR, snippets, and issues

The GitLab API did not check that the noteable object (issue, merge request or snippet) belonged to a project the attacker could access, so an attacker could post notes and votes on private objects. This could trigger note hooks configured by the project administrator and make it look like the attacker had access.

jobert Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 8 days
  • Disclosed after 8 days

Vulnerability details

By sending a specially crafted request to the GitLab API, an attacker can post notes on merge requests, snippets, and issues it doesn't have access to. This could execute additional note hooks that were configured by the project administrator.

Proof of concept

As a victim, create a private project. Within this project, create an issue. For this proof of concept, lets state that the issue has ID 1. As an attacker, create a new project that you have access to. In this PoC, the project has ID 2. By referencing a noteable_id (polymorphic relation, can be a MR, snippet, or issue) that doesn't belong to a project the attacker has access to, notes can be created for objects that the attacker isn't authorized to access. Here's a cURL command that references project ID 2 and issue ID 1 (which actually belongs to project ID 1):

Bash
curl -X POST --header "PRIVATE-TOKEN: XXXXXXXXXXXX" "http://gitlab-instance/api/v3/projects/2/issues/1/notes" --data "body=@all%20please%20fix%20this."

The attacker's private token was used to send this request. It posts a note to the issue with ID 1. This method can also be used to give up and down votes.

JSON
{
  "id":1,
  "body":"@all please fix this.",
  "attachment":null,
  "author": {
    "name":"John Doe",
    "username":"john",
    "id":4,
    "state":"active",
    "avatar_url":"http://www.gravatar.com/avatar/8ffb4b6252fa664afc7aeb9f48d1f196?s=80\u0026d=identicon",
    "web_url":"http://gitlab-instance/u/john"
  },
  "created_at":"2016-04-24T23:40:08.112Z",
  "system":false,
  "noteable_id":1,
  "noteable_type":"Issue",
  "upvote":false,
  "downvote":false
}

Impact

This vulnerability can be used to scare people because it looks like the unauthorized user has access to the issue, snippet, or merge request. I've looked at the notification services to leak the title of the noteable object, but the ACL checks in that class seem to be okay (it doesn't do anything if the mentioned user doesn't have access to the project).

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

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

Impact

An attacker could post notes and votes on private issues, merge requests and snippets, which could trigger administrator-configured note hooks and make it appear the attacker had access; the text notes that notification ACL checks appeared to be okay.

What the attacker needed

A GitLab account and private token; attacker owns a project; victim has a private project with an issue

How it was found

  1. As a victim, create a private project and an issue in it.
  2. As an attacker, create a project you have access to.
  3. Send a request to the notes endpoint of your own project but reference the victim's issue ID.
  4. The note is posted on the victim's private issue.

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 users comment on issues, merge requests and snippets through its API. The API checked that the attacker could use their own project, but not that the issue they were commenting on was in a project they were allowed to see. So an attacker could leave comments on private items they should not have been able to reach.

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 by jobert

View all

67 more disclosed reports, best first.

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.