CVE-2024-0402 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in GitLab

Critical 9.9 Published Updated

Authenticated users can write files to arbitrary locations on the GitLab server during workspace creation, potentially leading to code execution or data modification.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-0402?

CVE-2024-0402 is a critical path traversal vulnerability in Gitlab Gitlab, published on 26 Jan 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

An issue has been discovered in GitLab CE/EE affecting all versions from 16.0 prior to 16.6.6, 16.7 prior to 16.7.4, and 16.8 prior to 16.8.1 which allows an authenticated user to write files to arbitrary locations on the GitLab server while creating a workspace.

Weakness: CWE-22

Which versions are affected by CVE-2024-0402?

1 open source package ship an affected version, including gitlab. It affects 1 product.

PackageAffectedFixed in
gitlab BitnamiFrom 16.0.016.5.8, 16.6.6, 16.7.4, 16.8.1

Products include Gitlab Gitlab.

How do I fix CVE-2024-0402?

Upgrade gitlab to a fixed version for your release line: 16.5.8, 16.6.6, 16.7.4 or 16.8.1.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-0402 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-0402 exists.

Public exploit code: 1 proofs of concept on GitHub.

All Gitlab Gitlab vulnerabilities

Sources

Also known as BIT-gitlab-2024-0402, GHSA-3hm6-rvrr-hc6r, UBUNTU-CVE-2024-0402.

Is CVE-2024-0402 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free