Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsTraining
StudyProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Training
Study
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

2045+ Articles
153+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Checklists
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. News
  3. Researcher Publishes GitLab RCE PoC Letting Authenticated Users Run Commands as Git
Researcher Publishes GitLab RCE PoC Letting Authenticated Users Run Commands as Git
NEWS

Researcher Publishes GitLab RCE PoC Letting Authenticated Users Run Commands as Git

Security researcher Yuhang Wu published a working PoC exploiting two Ruby memory corruption vulnerabilities in the Oj JSON parser to achieve RCE as the git user on unpatched GitLab self-managed instances via crafted Jupyter notebook diffs.

Dylan H.

News Desk

July 25, 2026
5 min read

Working PoC Published for GitLab RCE Chain

Security researcher Yuhang Wu at depthfirst (Open Defense Initiative) has published a fully working proof-of-concept (PoC) exploit for a remote code execution vulnerability chain in GitLab. The exploit targets two chained Ruby memory corruption bugs in the Oj (Optimized JSON) gem used by GitLab's Jupyter notebook diff renderer, giving an authenticated attacker code execution as the git user running GitLab's Puma web workers.

The vulnerability affected GitLab Community and Enterprise Edition across a wide range — CE/EE 15.2.0 through 18.11.4 — and was silently present in production for over 1,700 days before disclosure.


The Vulnerability Chain

The attack chains two memory-safety bugs in the Oj Ruby JSON parser (versions 3.13.0–3.17.1), discovered through GitLab's use of the ipynbdiff gem for rendering Jupyter notebook file comparisons.

CVEs Involved

CVEDescription
CVE-2026-54502Stack buffer overflow in Oj.dump — write-beyond-bounds primitive
CVE-2026-54896Heap buffer overflow during exception serialization — read primitive
CVE-2026-54897 through CVE-2026-54903Additional use-after-free and integer overflow issues in Oj

Stage 1: Write Primitive (CVE-2026-54502)

An unchecked nesting stack in Oj's parser allows writing beyond a 1,024-byte stack buffer, corrupting the parser's internal buf.head pointer. A subsequent realloc caches the forged address, which a Ruby Array reclaims to overwrite a callback pointer — establishing an arbitrary write primitive.

Stage 2: Read Primitive / ASLR Defeat (CVE-2026-54896)

An unsafe 16-bit narrowing of a key-length field causes Oj to read from an inline buffer rather than the heap, leaking 8 bytes of a heap allocation. This enables the attacker to defeat ASLR and compute the base addresses needed for the gadget chain.

Exploit Delivery

1. Attacker creates two lexically-ordered crafted .ipynb files (Jupyter Notebooks)
2. Commits both files to a repository on the target GitLab instance
3. Requests the commit diff view in GitLab's web UI
4. GitLab's ipynbdiff gem calls Oj::Parser.usual.parse on the files
5. The two notebooks maintain corrupted parser state across sequential parses
   within a single Puma worker (maintaining the corrupt state between parses)
6. Gadget chain within libruby executes system() — max 39 bytes of command
7. Attacker achieves RCE as the `git` user on the Puma web worker

Affected Versions and Patches

GitLab Version RangeFixed In
CE/EE 15.2.0 – 18.10.718.10.8
CE/EE 18.11.0 – 18.11.418.11.5
CE/EE 19.0.0 – 19.0.119.0.2

Why This Matters

The vulnerability chain is notable for several reasons:

  • Long undetected window: The vulnerable parser code was merged into Oj on August 8, 2021. GitLab adopted Oj::Parser.usual.parse for notebook diffs on July 7, 2022. The bugs persisted undetected for over 1,753 days before disclosure in May 2026.
  • Authenticated-only barrier is low: Any authenticated GitLab user — including free accounts on self-managed instances — can trigger the exploit.
  • Self-managed deployments specifically at risk: GitLab.com is managed by GitLab and patched immediately; self-managed operators must apply patches themselves.
  • PoC is now public: With a working PoC published, exploitation risk for unpatched instances escalates rapidly.

Disclosure Timeline

DateEvent
Aug 8, 2021Vulnerable parser code merged into Oj gem
Jul 7, 2022GitLab adopted Oj::Parser.usual.parse for notebook diffs
May 21, 2026Vulnerabilities reported to Oj maintainers
May 27, 2026Fixes merged into Oj gem
Jun 10, 2026GitLab releases patched versions (18.10.8, 18.11.5, 19.0.2)
Jul 25, 2026Yuhang Wu publishes full PoC and writeup

Remediation

Immediate: Upgrade GitLab

Update your self-managed GitLab instance to the patched release for your branch:

# Check current GitLab version
gitlab-rake gitlab:env:info | grep "GitLab version"
 
# Ubuntu/Debian — upgrade GitLab package
sudo apt-get update && sudo apt-get install gitlab-ee
 
# RHEL/CentOS
sudo yum update gitlab-ee
 
# Verify version after upgrade
gitlab-rake gitlab:env:info | grep "GitLab version"

If Immediate Upgrade Is Not Possible

Disable the Jupyter notebook diff rendering feature:

# In GitLab Rails console
Feature.disable(:jupyter_notebook_diff)

Or restrict repository access to trusted users only until patching is complete.

Detection

Review GitLab application logs for exploitation attempts:

# Check for anomalous diff requests involving .ipynb files
grep -i "ipynb" /var/log/gitlab/gitlab-rails/production.log | grep "diff"
 
# Monitor for unexpected child process spawning from Puma workers
sudo grep "puma" /var/log/audit/audit.log | grep "execve"

References

  • depthfirst — Going Depthfirst: Achieving GitLab RCE via Two Ruby Memory Corruption Vulnerabilities
  • The Hacker News — Researcher Publishes GitLab RCE PoC
  • GitLab ipynbdiff gem

Related Reading

  • CVE-2026-15704: Critical Auth Bypass in Eclipse BaSyx Go Components
  • Critical RCE in WPvivid Backup Plugin Threatens 900,000+
#GitLab#RCE#PoC#CVE-2026-54502#Ruby#Jupyter#Memory Corruption#DevSecOps

Related Articles

New Exim BDAT Vulnerability Exposes GnuTLS Builds to Potential Code Execution

Exim has released security updates to patch a severe vulnerability affecting GnuTLS-compiled builds of the world's most widely deployed mail transfer...

7 min read

Kimi K3 AI Agents Discovered Redis Zero-Days and Built RCE Exploits in Under 90 Minutes

Autonomous AI agents powered by Moonshot AI's Kimi K3 model found 19 Redis zero-day vulnerabilities and produced working authenticated RCE proof-of-concept exploits in roughly 90 minutes, prompting Redis to ship seven security releases on July 23, 2026.

4 min read

WordPress wp2shell Exploitation Grows as Public Exploit Fuels Mass Scanning

Attackers are exploiting two chained critical WordPress vulnerabilities that enable unauthenticated remote code execution. A public exploit has triggered mass scanning campaigns targeting exposed WordPress installations globally.

6 min read
Back to all News