Critical GitLab Vulnerabilities Enable Remote Code Execution on Default Installations
2026-07-27 05:29:20
Security researchers have disclosed a critical exploit chain affecting GitLab Community Edition (CE) and Enterprise Edition (EE) that allows authenticated attackers to achieve remote code execution (RCE) on vulnerable self-managed GitLab servers.
The attack combines two memory-safety vulnerabilities in Oj, a high-performance JSON parsing library widely used in Ruby applications, including GitLab. By chaining the flaws together, attackers can execute arbitrary commands on the server, potentially exposing source code, application secrets, and internal infrastructure.
Exploit Targets the Oj JSON Parser
The vulnerabilities were discovered by security researcher Yuhang Wu during the Open Defense Initiative using an automated vulnerability analysis system.
The research identified 18 potential security issues within the Oj library, including seven memory-safety vulnerabilities. Two of those flaws, which reportedly remained undiscovered for nearly five years, were combined into a working remote code execution exploit.
One vulnerability involved an unchecked nesting-stack write inside the JSON parser, while the second exposed portions of heap memory through improper handling of object key lengths. Individually, the bugs offered only limited capabilities, but together they enabled attackers to bypass memory protection mechanisms and execute arbitrary code.
Jupyter Notebook Parsing Creates the Attack Path
The exploit specifically targets GitLab's processing of Jupyter Notebook (.ipynb) files.
When GitLab generates a visual comparison between notebook revisions, it parses the JSON content using the vulnerable Oj library to verify notebook structure. Researchers demonstrated that an attacker could upload specially crafted notebook files containing malicious JSON data.
By submitting two carefully designed notebook files within the same commit, attackers could manipulate the parser's memory, leak critical address information needed to bypass Address Space Layout Randomization (ASLR), and ultimately redirect execution flow to launch arbitrary shell commands.
The exploit executes with the privileges of the "git" system account used by GitLab's Puma application server.
Potential Impact
Successful exploitation may allow attackers to:
Execute arbitrary commands on the GitLab server.
Access private source code repositories.
Steal Rails application secrets and service credentials.
Retrieve sensitive configuration files.
Move laterally to internal network services accessible from the GitLab host.
Modify repositories or compromise development infrastructure.
Researchers note that the attack requires only standard repository permissions. Any authenticated project member capable of pushing commits and viewing commit diffs could potentially trigger the vulnerability without administrator privileges, CI/CD access, or user interaction.
Affected Versions
The vulnerability affects the following GitLab releases:
Product Vulnerable Versions Fixed Version
GitLab CE/EE 15.2.0 – 18.10.7 18.10.8
GitLab CE/EE 18.11.0 – 18.11.4 18.11.5
GitLab CE/EE 19.0.0 – 19.0.1 19.0.2
Oj Ruby Gem 3.13.0 – 3.17.1 3.17.3
GitLab.com had already been updated before public disclosure, and GitLab Dedicated customers were not required to take any action. However, organizations operating self-managed GitLab instances should upgrade immediately.
Vulnerabilities Patched
According to the disclosure timeline, the underlying Oj library vulnerabilities were reported in May 2026 and fixed in Oj version 3.17.3. The GitLab-specific exploit chain was subsequently reported, verified, and patched in GitLab 19.0.2, 18.11.5, and 18.10.8.
The broader research also uncovered several additional vulnerabilities within the Oj library, including heap and stack buffer overflows, use-after-free conditions, integer overflows, and unsafe memory operations, highlighting the security risks posed by native C extensions used within otherwise memory-safe programming environments.
Recommendations
Organizations running self-managed GitLab servers should upgrade to the latest patched release as soon as possible and verify that the vulnerable Oj dependency has been updated.
Security teams are also encouraged to review Ruby applications for native C-based dependencies, as vulnerabilities within third-party extensions can undermine the overall security of applications built on memory-safe languages.
The attack combines two memory-safety vulnerabilities in Oj, a high-performance JSON parsing library widely used in Ruby applications, including GitLab. By chaining the flaws together, attackers can execute arbitrary commands on the server, potentially exposing source code, application secrets, and internal infrastructure.
Exploit Targets the Oj JSON Parser
The vulnerabilities were discovered by security researcher Yuhang Wu during the Open Defense Initiative using an automated vulnerability analysis system.
The research identified 18 potential security issues within the Oj library, including seven memory-safety vulnerabilities. Two of those flaws, which reportedly remained undiscovered for nearly five years, were combined into a working remote code execution exploit.
One vulnerability involved an unchecked nesting-stack write inside the JSON parser, while the second exposed portions of heap memory through improper handling of object key lengths. Individually, the bugs offered only limited capabilities, but together they enabled attackers to bypass memory protection mechanisms and execute arbitrary code.
Jupyter Notebook Parsing Creates the Attack Path
The exploit specifically targets GitLab's processing of Jupyter Notebook (.ipynb) files.
When GitLab generates a visual comparison between notebook revisions, it parses the JSON content using the vulnerable Oj library to verify notebook structure. Researchers demonstrated that an attacker could upload specially crafted notebook files containing malicious JSON data.
By submitting two carefully designed notebook files within the same commit, attackers could manipulate the parser's memory, leak critical address information needed to bypass Address Space Layout Randomization (ASLR), and ultimately redirect execution flow to launch arbitrary shell commands.
The exploit executes with the privileges of the "git" system account used by GitLab's Puma application server.
Potential Impact
Successful exploitation may allow attackers to:
Execute arbitrary commands on the GitLab server.
Access private source code repositories.
Steal Rails application secrets and service credentials.
Retrieve sensitive configuration files.
Move laterally to internal network services accessible from the GitLab host.
Modify repositories or compromise development infrastructure.
Researchers note that the attack requires only standard repository permissions. Any authenticated project member capable of pushing commits and viewing commit diffs could potentially trigger the vulnerability without administrator privileges, CI/CD access, or user interaction.
Affected Versions
The vulnerability affects the following GitLab releases:
Product Vulnerable Versions Fixed Version
GitLab CE/EE 15.2.0 – 18.10.7 18.10.8
GitLab CE/EE 18.11.0 – 18.11.4 18.11.5
GitLab CE/EE 19.0.0 – 19.0.1 19.0.2
Oj Ruby Gem 3.13.0 – 3.17.1 3.17.3
GitLab.com had already been updated before public disclosure, and GitLab Dedicated customers were not required to take any action. However, organizations operating self-managed GitLab instances should upgrade immediately.
Vulnerabilities Patched
According to the disclosure timeline, the underlying Oj library vulnerabilities were reported in May 2026 and fixed in Oj version 3.17.3. The GitLab-specific exploit chain was subsequently reported, verified, and patched in GitLab 19.0.2, 18.11.5, and 18.10.8.
The broader research also uncovered several additional vulnerabilities within the Oj library, including heap and stack buffer overflows, use-after-free conditions, integer overflows, and unsafe memory operations, highlighting the security risks posed by native C extensions used within otherwise memory-safe programming environments.
Recommendations
Organizations running self-managed GitLab servers should upgrade to the latest patched release as soon as possible and verify that the vulnerable Oj dependency has been updated.
Security teams are also encouraged to review Ruby applications for native C-based dependencies, as vulnerabilities within third-party extensions can undermine the overall security of applications built on memory-safe languages.