CVE-2023-3401 Improper Control of Generation of Code ('Code Injection') in GitLab

Medium 4.8 Published Updated

An attacker can inject malicious code into GitLab repositories by using a specially designed branch name, leading to code execution.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-3401?

CVE-2023-3401 is a medium-severity code injection vulnerability in Gitlab Gitlab, published on 2 Aug 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

An issue has been discovered in GitLab affecting all versions before 16.0.8, all versions starting from 16.1 before 16.1.3, all versions starting from 16.2 before 16.2.2. The main branch of a repository with a specially designed name allows an attacker to create repositories with malicious code.

Weakness: CWE-94

Which versions are affected by CVE-2023-3401?

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

PackageAffectedFixed in
gitlab BitnamiAll versions16.0.8, 16.1.3, 16.2.2

Products include Gitlab Gitlab.

How do I fix CVE-2023-3401?

Upgrade gitlab to a fixed version for your release line: 16.0.8, 16.1.3 or 16.2.2.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2023-3401 being exploited?

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

All Gitlab Gitlab vulnerabilities

Sources

Also known as BIT-gitlab-2023-3401, GHSA-722v-49rj-hh57, UBUNTU-CVE-2023-3401.

Is CVE-2023-3401 in your software?

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

Check your SBOMs for free