CVE-2025-5101 Improper Control of Generation of Code ('Code Injection') in GitLab

Medium 5.0 Published Updated

Authenticated attackers can inject malicious code via branch/tag ambiguity during repository imports, leading to code execution.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-5101?

CVE-2025-5101 is a medium-severity code injection vulnerability in Gitlab Gitlab, published on 27 Aug 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

An issue has been discovered in GitLab CE/EE affecting all versions before 18.1.5, 18.2 before 18.2.5, and 18.3 before 18.3.1 that under certain conditions could have allowed an authenticated attacker to distribute malicious code that appears harmless in the web interface by taking advantage of ambiguity between branches and tags during repository imports.

Weakness: CWE-94

Which versions are affected by CVE-2025-5101?

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

PackageAffectedFixed in
gitlab BitnamiAll versions18.1.5, 18.2.5, 18.3.1

Products include Gitlab Gitlab.

How do I fix CVE-2025-5101?

Upgrade gitlab to a fixed version for your release line: 18.1.5, 18.2.5 or 18.3.1.

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

Is CVE-2025-5101 being exploited?

There is no known exploitation of CVE-2025-5101 in the wild and no public exploit code.

All Gitlab Gitlab vulnerabilities

Sources

Also known as BIT-gitlab-2025-5101, GHSA-3c57-hg33-rhrp, MINI-259q-jrp7-r8jq, MINI-7r9w-2q27-v8q4, MINI-gm8q-6f55-g76v, MINI-hgm2-c83f-975j and 4 more.

Is CVE-2025-5101 in your software?

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

Check your SBOMs for free