CVE-2024-0402: Arbitrary File Write in GitLab CE/EE Workspaces
- Vendor
- GitLab
CVE-2024-0402 is a critical arbitrary file write vulnerability in GitLab Community Edition and Enterprise Edition Workspaces. It affects versions 16.0 through before 16.5.8, 16.6 through before 16.6.6, 16.7 through before 16.7.4, and 16.8 through before 16.8.1. The flaw allows an authenticated user to write files to arbitrary locations on the GitLab server during workspace creation. Available technical analysis indicates the issue is reachable through processing of workspace devfile content and involves insufficient restriction of file extraction paths in the devfile handling chain, enabling path traversal during archive decompression and resulting in server-side arbitrary file write.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows a low-privilege authenticated attacker to place attacker-controlled files at arbitrary locations on the GitLab server. This can be used to deploy webshells or other malware, overwrite sensitive files, obtain code execution or privileged shell access depending on the chosen target path, compromise the GitLab instance, and potentially facilitate data theft or further movement within the environment. Public technical discussion also describes practical escalation from file write to control of the GitLab host and administrative takeover of the GitLab application.
Mitigation
If you can’t patch tonight, do this now.
If immediate patching is not possible, reduce exposure of GitLab to untrusted users, especially any users able to create workspaces or commit to repositories used for workspace creation. Restrict access to the GitLab instance through VPN or zero-trust controls, disable open user sign-up where feasible, and increase monitoring for suspicious workspace creation activity and unexpected file modifications on the GitLab server. These measures only reduce exposure and do not eliminate the vulnerability; patching is required. Patching also does not remediate any prior compromise.
Remediation
Patch, then assume compromise.
Upgrade GitLab CE/EE to a fixed release. The issue is fixed in 16.5.8, 16.6.6, 16.7.4, and 16.8.1. GitLab indicated that 16.5.8 was a backport containing the fix for this vulnerability. Apply the vendor-supported patched version appropriate for the deployed branch after standard change validation.
Exploits
1 exploit validated by Mallory's analysis.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Frequently asked questions
- Is CVE-2024-0402 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2024-0402 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2024-0402?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2024-0402, the earliest disclosed Mar 10, 2025.
- Is there a patch for CVE-2024-0402?
- Upgrade GitLab CE/EE to a fixed release. The issue is fixed in 16.5.8, 16.6.6, 16.7.4, and 16.8.1.
- What products are affected by CVE-2024-0402?
- Gitlab.
- How severe is CVE-2024-0402?
- CVE-2024-0402 has a CVSS v3.1 score of 9.9 (Critical) and an EPSS score of 3.8% (90th percentile) as of Oct 16, 2026.
Recent activity
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.