Skip to content
Info disclosure Disclosed report Beginner

Gitlab search allows leaking internal notes

The GitLab search count API returned the number of matching internal notes even for users without permission to view them. An attacker could brute-force the content of internal notes by testing search prefixes and observing the count.

GitLab

Originally disclosed on GitLab

  • Fixed in 2 months
  • Disclosed after 2 months

HackerOne report #1829768 by shells3c on 2023-01-10, assigned to @ameyadarshan:

Report | How To Reproduce

Report

Summary

Gitlab search count API returns the count of results gotten from internal notes despite users having no permission to view those notes. This results in guessing/brute-forcing the internal notes

Steps to reproduce
  1. Create a public project, then a public issue and make an internal note with the message: Internal comment
  2. Logout and do the following tests:

https://gitlab.com/search/count?project_id=<ID>&scope=notes&search="Internal c"

JSON
{"count":"1"}  

https://gitlab.com/search/count?project_id=<ID>&scope=notes&search="Internal cc"

JSON
{"count":"0"}  

https://gitlab.com/search/count?project_id=<ID>&scope=notes&search="Internal co"

JSON
{"count":"1"}  

https://gitlab.com/search/count?project_id=<ID>&scope=notes&search="Internal comment"

JSON
{"count":"1"}  
Examples

I have created an example project for testing:

curl 'https://gitlab.com/search/count?project_id=25681831&scope=notes&search=%22CVE-2021-1234%22'

JSON
{"count":"1"}  

You can confirm that the note CVE-2021-1234 exists, even though you can't see it in the Gitlab search results: https://gitlab.com/search?project_id=25681831&scope=notes&search=%22CVE-2021-1234%22

Impact

Leaking internal notes of public issues

How To Reproduce

Please add reproducibility information to this section:

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 search count endpoint did not apply the same permission checks as the regular search results, so it counted internal notes for unauthorised users.

Impact

An unauthenticated attacker could confirm the existence and guess the content of internal notes on public projects by brute-forcing search terms and observing the count.

What the attacker needed

A public project with an internal note; no authentication required

How it was found

  1. Create a public project and a public issue, then add an internal note with a known message.
  2. Log out and send a request to the search count endpoint with the project ID, scope set to notes, and a search term.
  3. Observe that the count is 1 when the search term matches the internal note, and 0 when it does not.

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.

Internal notes are private comments on issues that only project members can see. The search count feature told anyone how many private comments matched a search term, even if they weren't allowed to read them. By trying different search terms, an attacker could guess the content of those private comments.

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.