Skip to content
Access control Disclosed report Intermediate

GitLab Duo Chat can access issues and epics in IP restricted projects

GitLab Duo Chat did not enforce IP restrictions on projects, allowing users outside the allowed IP range to access issues and epics via chat. An attacker could bypass IP blocklists and leak sensitive information from IP-restricted projects.

GitLab

Originally disclosed on GitLab

  • Fixed in 3 months
  • Disclosed after 3 months

⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.

HackerOne report #2417607 by joaxcar on 2024-03-14, assigned to @greg:

Report | How To Reproduce

Report

Summary

I am just starting to look at the Duo AI capabilities, so bear with me if I have not fully understood the threat model yet.

On a Premium or Ultimate license group there is the option to restrict access to the Group and the groups projects using a IP restriction list. See documentation. Enabling this on a group will prevent all access to issues and epics in the group when not requesting it from inside that IP range.

Issues in the project are not accessible through either the UI or any API.

What I noticed is that the Duo chat is not restricted by IP block lists. Thus, these two scenarios will allow for a bypass:

  1. A member of a private IP-restricted group can access all issues and epics from outside the IP range using Duo Chat
  2. Any member on the GitLab instance can access issues and epics from public projects even if they are behind an IP restriction

Number 2 here is worse than number 1, but the documentation for IP restrictions does state that

While IP restrictions apply to public projects, they aren’t a complete firewall and cached files for a project may still be accessible to users not in the IP block

Still, there might exist groups that rely on IP blocklists to work as a sort of internal accessibility, even on GitLab SAAS.

Steps to reproduce
  1. To access duo chat a user needs to be member of a group with at least Premium subscription and where Experimental features are turned on. See link

  2. Create two accounts on https://gitlab.com, and make sure that both have an Ultimate trial (this is to get access to Duo chat)

  3. Log in as the victim and create a group with an Ultimate license (make it public)

  4. Create a project in the group (make it public)

  5. Create an issue in the project

  6. Go to https://gitlab.com/groups/GROUPNAME/-/edit and expand "Permissions and group features"

  7. Enter 1.1.1.1 in the Restrict access by IP address field. Scroll down a bit and click Save

  8. Now try to access https://gitlab.com/GROUPNAME/PROJECTNAME/-/issues/1

The user will be blocked

  1. Now log in as the attacker user. This user is not a member of the restricted but public group
  2. Try to access https://gitlab.com/GROUPNAME/PROJECTNAME/-/issues/1 the user will get a 404
  3. Open Duo Chat (either in top right or under "help")
  4. Type this in chat
Summarize: https://gitlab.com/GROUPNAME/PROJECTNAME/-/issues/1  
  1. Duo chat will think for a bit and then give you a summary of the issue
Impact

Users can bypass IP blocklist using Duo Chat, leaking issues and epics to users outside the IP range

What is the current bug behavior?

Duo chat does not seem to care about IP blocklists

What is the expected correct behavior?

Duo Chat should check where the user is located when making requests for issues and epics

Impact

Users can bypass IP blocklist using Duo Chat, leaking issues and epics to users outside the IP range

How To Reproduce

Please add reproducibility information to this section:

Implementation Proposal

Create a Sidekiq middleware, which would assign the IP address to Gitlab::IpAddressState.current. The IP address is available from meta.remote_ip which is part of the job. This will be done in the public repository because we want to guard this logic by a feature flag (default enabled).

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 Duo Chat feature did not check the user's IP address against the project's IP restriction settings when fetching issue or epic content.

Impact

Users can bypass IP blocklist using Duo Chat, leaking issues and epics to users outside the IP range.

What the attacker needed

GitLab Ultimate trial for Duo Chat; Experimental features enabled; Victim has IP-restricted group/project; Attacker has GitLab account

The fix

Duo Chat should check the user's IP address when making requests for issues and epics.

How it was found

  1. Create two accounts with Ultimate trial to access Duo Chat.
  2. As victim, create a public group with Ultimate license and a public project with an issue.
  3. Enable IP restriction on the group by entering an IP address in the settings.
  4. Verify that accessing the issue directly is blocked for the attacker.
  5. As attacker, open Duo Chat and ask it to summarise the issue URL.
  6. Duo Chat returns a summary of the issue despite the IP restriction.

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.

IP restrictions are a way to limit who can access a group or project based on their network address. GitLab Duo Chat is an AI assistant that can summarise content from links. The bug meant that even if a project was restricted to certain IP addresses, the chat could still fetch and summarise issues from that project, letting anyone see the content.

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