Skip to content
Info disclosure Disclosed report Intermediate

Elastic Search returns private comments of restricted projects

Elastic Search returned private comments and related metadata (issue titles, merge request titles, commit SHAs, snippet titles) from public projects with restricted features to unauthenticated users. An attacker could search for and read this private information without being a project member.

GitLab

Originally disclosed on GitLab

  • Fixed in 29 days
  • Disclosed after 29 days

HackerOne report #710430 by xanbanx on 2019-10-09, assigned to @jeremymatos:

Hi GitLab Security Team,

Summary

I saw that GitLab release two critical security releases regarding the Elastic Search feature.
It seems this is not yet fixed properly. GitLab still returns private comments for restricted public projects.

Here, the project is configured such that features (issues, merge requests, repo, snippets) are restricted to project members only. however, Elastic Search now returns comments, e.g, on issues, MRs, commits, snippets, to unauthenticated users, which are not project members,

Steps to reproduce

Tested on a local installation of GitLab Enterprise Edition 12.3.0-pre f560feddaaa

  1. Setup Elastic Search and enable advanced search
  2. On GitLab, create a public project where all features (issues, repos, merge requests, snippets) are restricted to project members only
  3. Create an issue with an additional note, a merge request with an additional note, and comment on a commit, and a snippet with a comment
  4. As an unauthenticated user, search for that comment

Thus, this is leaking:

  • the comment
  • Issue title
  • Merge request title
  • Commit Sha
  • Snippet title

See the screenshot below.

Impact

Unauthenticated users can search for comments for private comments. Furthermore, they get to know the issue, merge request titles, and snippet titles, but also commit SHAs.

What is the current bug behavior?

Unauthorized users have access to private information such as the comments and related meta information (issue, MR, snippet titles)

What is the expected correct behavior?

Search needs to take project feature visibility into account.

Results of GitLab environment info

This was tested on a local installation of GDK from today.

Bash
System information  
System:         Ubuntu 19.04  
Proxy:          no  
Current User:   xanbanx  
Using RVM:      yes  
RVM Version:    1.29.9  
Ruby Version:   2.6.3p62  
Gem Version:    3.0.6  
Bundler Version:1.17.3  
Rake Version:   12.3.3  
Redis Version:  5.0.3  
Git Version:    2.23.0  
Sidekiq Version:5.2.7  
Go Version:     go1.12.6 linux/amd64

GitLab information  
Version:        12.3.0-pre  
Revision:       f560feddaaa  
Directory:      /home/xanbanx/gdk/gdk/gitlab  
DB Adapter:     PostgreSQL  
DB Version:     11.5  
URL:            http://localhost:3000  
HTTP Clone URL: http://localhost:3000/some-group/some-project.git  
SSH Clone URL:  ssh://xanbanx@localhost:2222/some-group/some-project.git  
Elasticsearch:  yes  
Geo:            no  
Using LDAP:     no  
Using Omniauth: yes  
Omniauth Providers: 

GitLab Shell  
Version:        10.0.0  
Repository storage paths:  
- default:      /home/xanbanx/gdk/gdk/repositories  
GitLab Shell path:              /home/xanbanx/gdk/gdk/gitlab-shell  
Git:            /usr/bin/git  

Best regards,
Xanbanx

Impact

See above.

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 Elastic Search integration did not enforce project feature visibility when returning search results.

Impact

Unauthenticated users could search for and read private comments and related metadata (issue titles, merge request titles, commit SHAs, snippet titles) from restricted projects.

What the attacker needed

Elastic Search enabled; Public project with restricted features; Unauthenticated access

How it was found

  1. Set up Elastic Search and enable advanced search.
  2. Create a public project where all features are restricted to project members only.
  3. Create an issue with a note, a merge request with a note, a commit comment, and a snippet with a comment.
  4. As an unauthenticated user, search for that comment.

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, you can make a public project but restrict its features (like issues or merge requests) to members only. The search feature, powered by Elastic Search, did not check these restrictions, so anyone could search and see private comments and titles. This means outsiders could read information that should be hidden.

What is Info disclosure?

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

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.