Skip to content
Info disclosure Disclosed report Beginner

Elasticsearch leaks data through the notes scope

Elasticsearch search results for the notes scope did not properly check access permissions, so an anonymous or unauthorised user could see private notes that revealed the existence of private groups, projects, and issues. An attacker could use this to learn about private resources they should not be able to see.

rpadovani Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 28 days
  • Paid in 6 days
  • Disclosed after 12 months

Summary

The Elasticsearch results, when filtering using the notes scope, leaks data about private groups, private projects, and private issues.

Steps to reproduce

  1. Search, as an anonymous user, nextbit in the Gitlab group, filtering for "comments" (link)
  2. You will have as result a private note saying Riccardo Padovani mentioned in nextbit/virtualcore/gui#109 (see screenshot). This basically leaks information about the existence of a private group, a private subgroup, a private project, the ID of an issue in the project, and a membership of the project. 3. You can also retrieve more data through the APIs:
19:55:18 in ~ 
➜ curl "https://gitlab.com/api/v4/projects/278964/search?scope=notes&search=nextbit" --header "PRIVATE-TOKEN: TEST" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   520  100   520    0     0    508      0  0:00:01  0:00:01 --:--:--   508
[
  {
    "id": 215547575,
    "type": null,
    "body": "mentioned in issue nextbit/VirtualCore/gui#109",
    "attachment": null,
    "author": {
      "id": 16048,
      "name": "Riccardo Padovani",
      "username": "rpadovani",
      "state": "active",
      "avatar_url": "https://secure.gravatar.com/avatar/9d89d4072afb4457b0c49131d8d258f5?s=80&d=identicon",
      "web_url": "https://gitlab.com/rpadovani"
    },
    "created_at": "2019-02-19T12:54:23.670Z",
    "updated_at": "2019-02-19T12:54:23.670Z",
    "system": true,
    "noteable_id": 24685040,
    "noteable_type": "Issue",
    "resolvable": false,
    "noteable_iid": 25362
  }
]

The token used is from another account, whom doesn't have access to nextbit, or doesn't have any relation with the mentioned issue. It is necessary 'cause search APIs can be used only by logged users.

The ID of the project where we perform the search is the Gitlab one.

Impact

Elasticsearch doesn't properly authorize access to the notes in search results, so there are leaks of private data, given the right search query.

Output of checks

This bug happens on GitLab.com

Impact

Elasticsearch doesn't properly authorize access to the notes in search results, so there are leaks of private data, given the right search query

Attachments

Screenshot_2019-10-08_nextbit___Search.png
Screenshot_2019-10-08_nextbit___Search.png From the original on HackerOne

The original report as published on HackerOne, by rpadovani. 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

Root cause

Likely the search integration with Elasticsearch did not apply the same access-control checks to notes as it did to other searchable items, so private notes were returned to users without permission.

Impact

Private notes could be exposed, leaking the existence and details of private groups, projects, and issues to users who should not have access.

What the attacker needed

None for web search as anonymous user; a token from any account for API search

How it was found

  1. As an anonymous user, search for a term in a GitLab group with the notes scope.
  2. Observe that a private note appears in the results, revealing private group, project, and issue details.
  3. Use the API with a token from an unrelated account to retrieve the same private note data.

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.

When you search on a website, the search engine should only show you things you are allowed to see. Here, the search system (Elasticsearch) forgot to check who is allowed to see certain comments (notes), so it showed private comments to anyone. This let people discover private groups and projects just by searching.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by rpadovani

View all

6 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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.