Rapid7 Vulnerability & Exploit Database

GitLab Authenticated File Read

Back to Search

GitLab Authenticated File Read

Disclosed
05/23/2023
Created
06/07/2023

Description

GitLab version 16.0 contains a directory traversal for arbitrary file read as the `gitlab-www` user. This module requires authentication for exploitation. In order to use this module, a user must be able to create a project and groups. When exploiting this vulnerability, there is a direct correlation between the traversal depth, and the depth of groups the vulnerable project is in. The minimum for this seems to be 5, but up to 11 have also been observed. An example of this, is if the directory traversal needs a depth of 11, a group and 10 nested child groups, each a sub of the previous, will be created (adding up to 11). Visually this looks like: Group1->sub1->sub2->sub3->sub4->sub5->sub6->sub7->sub8->sub9->sub10. If the depth was 5, a group and 4 nested child groups would be created. With all these requirements satisfied a dummy file is uploaded, and the full traversal is then executed. Cleanup is performed by deleting the first group which cascades to deleting all other objects created.

Author(s)

  • h00die
  • pwnie
  • Vitellozzo

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use auxiliary/gather/gitlab_authenticated_subgroups_file_read
msf auxiliary(gitlab_authenticated_subgroups_file_read) > show actions
    ...actions...
msf auxiliary(gitlab_authenticated_subgroups_file_read) > set ACTION < action-name >
msf auxiliary(gitlab_authenticated_subgroups_file_read) > show options
    ...show and set options...
msf auxiliary(gitlab_authenticated_subgroups_file_read) > run 

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;