module

GitLab Authenticated File Read

Disclosed
2023-05-23
Created
2023-06-07

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.

Authors

h00die
pwnie
Vitellozzo

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

Title
NEW

Explore Exposure Command

Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.