Skip to main content

CVE-2023-6051: CWE-94: Improper Control of Generation of Code ('Code Injection') in GitLab GitLab

Medium
VulnerabilityCVE-2023-6051cvecve-2023-6051cwe-94
Published: Fri Dec 15 2023 (12/15/2023, 16:02:50 UTC)
Source: CVE
Vendor/Project: GitLab
Product: GitLab

Description

An issue has been discovered in GitLab CE/EE affecting all versions before 16.4.4, all versions starting from 16.5 before 16.5.4, all versions starting from 16.6 before 16.6.2. File integrity may be compromised when source code or installation packages are pulled from a specific tag.

AI-Powered Analysis

AILast updated: 07/07/2025, 11:58:16 UTC

Technical Analysis

CVE-2023-6051 is a medium-severity vulnerability classified under CWE-94, which pertains to improper control of code generation, commonly known as code injection. This vulnerability affects GitLab Community Edition (CE) and Enterprise Edition (EE) across multiple versions: all versions before 16.4.4, versions starting from 16.5 up to but not including 16.5.4, and versions starting from 16.6 up to but not including 16.6.2. The core issue arises when source code or installation packages are pulled from a specific tag, potentially allowing an attacker to inject malicious code that compromises file integrity. The vulnerability requires network access (AV:N), low attack complexity (AC:L), and privileges (PR:L) with user interaction (UI:R). The scope remains unchanged (S:U), and the impact affects integrity (I:H) but not confidentiality or availability. Although no known exploits are currently reported in the wild, the vulnerability could allow an attacker with limited privileges and user interaction to alter code or installation packages, leading to unauthorized code execution or manipulation of the software supply chain within GitLab environments. This could undermine the trustworthiness of the development lifecycle and potentially introduce backdoors or malicious payloads into software projects managed via GitLab.

Potential Impact

For European organizations, the impact of CVE-2023-6051 is significant due to the widespread adoption of GitLab as a DevOps platform across industries including finance, manufacturing, telecommunications, and government sectors. Compromise of file integrity in GitLab repositories or installation packages can lead to injection of malicious code into production software, causing downstream security breaches, data integrity issues, and compliance violations under regulations such as GDPR and NIS Directive. The requirement for low privileges and user interaction means insider threats or targeted phishing campaigns could exploit this vulnerability. The disruption of software development pipelines can delay critical updates and introduce vulnerabilities into deployed applications, affecting operational continuity and trust in software supply chains. Given the critical role of GitLab in CI/CD workflows, exploitation could also impact intellectual property protection and expose organizations to reputational damage and financial losses.

Mitigation Recommendations

European organizations should prioritize upgrading GitLab instances to the fixed versions: 16.4.4 or later for versions before 16.5, 16.5.4 or later for the 16.5 series, and 16.6.2 or later for the 16.6 series. Until patches are applied, restrict access to GitLab repositories and CI/CD pipelines to trusted users only, enforce strict privilege management to minimize users with write or merge permissions, and implement multi-factor authentication to reduce risk of credential compromise. Additionally, monitor GitLab logs for unusual activity related to tag creation or package pulls, and conduct code reviews and integrity checks on critical repositories. Employ network segmentation to isolate GitLab servers from less trusted networks and consider using software composition analysis tools to detect injected or tampered code. Educate users about phishing risks to reduce the likelihood of user interaction exploitation. Finally, maintain offline backups of critical repositories to enable recovery in case of compromise.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitLab
Date Reserved
2023-11-09T12:30:30.298Z
Cisa Enriched
false
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682ea68a0acd01a249253fc7

Added to database: 5/22/2025, 4:22:34 AM

Last enriched: 7/7/2025, 11:58:16 AM

Last updated: 7/28/2025, 5:28:26 PM

Views: 17

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats