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:
- A member of a
privateIP-restricted group can access all issues and epics from outside the IP range usingDuo Chat - Any member on the GitLab instance can access issues and epics from
publicprojects 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
-
To access
duo chata user needs to be member of a group with at least Premium subscription and whereExperimental featuresare turned on. See link -
Create two accounts on https://gitlab.com, and make sure that both have an Ultimate trial (this is to get access to Duo chat)
-
Log in as the victim and create a group with an
Ultimatelicense (make itpublic) -
Create a project in the group (make it
public) -
Create an issue in the project
-
Go to https://gitlab.com/groups/GROUPNAME/-/edit and expand "Permissions and group features"
-
Enter
1.1.1.1in theRestrict access by IP addressfield. Scroll down a bit and clickSave -
Now try to access https://gitlab.com/GROUPNAME/PROJECTNAME/-/issues/1
The user will be blocked
- Now log in as the
attackeruser. This user is not a member of the restricted but public group - Try to access https://gitlab.com/GROUPNAME/PROJECTNAME/-/issues/1 the user will get a 404
- Open Duo Chat (either in top right or under "help")
- Type this in chat
Summarize: https://gitlab.com/GROUPNAME/PROJECTNAME/-/issues/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).
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
- Create two accounts with Ultimate trial to access Duo Chat.
- As victim, create a public group with Ultimate license and a public project with an issue.
- Enable IP restriction on the group by entering an IP address in the settings.
- Verify that accessing the issue directly is blocked for the attacker.
- As attacker, open Duo Chat and ask it to summarise the issue URL.
- 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.