Skip to content
RCE Write-up Advanced

GitLab RCE Vulnerability Explained: The Notebook Diff Exploit Chain

Two memory-safety bugs in the Oj JSON parser used by GitLab's notebook-diff feature could be chained to gain control of a callback pointer and defeat ASLR, leading to remote code execution. An authenticated user with ordinary push and diff-view permissions could trigger it without victim interaction.

xpert4cyber Follow

Published on medium.com

GitLab just patched a remote code execution vulnerability that never got a CVE, never got a security advisory, and was triggered by something as routine as pushing a Jupyter notebook and viewing its diff.

Xpert4Cyber, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely memory-safety flaws in the native Oj JSON parser, reachable through the notebook-diff feature, that allowed a callback pointer to be overwritten and address-space layout randomisation to be defeated.

Impact

An authenticated user with ordinary push and diff-view permissions could execute code as the git system user, exposing source code, Rails secrets, CI/CD tokens and internal services reachable from the GitLab host.

What the attacker needed

Authenticated GitLab account; push permission on a project; ability to view a notebook diff; self-managed GitLab instance

The fix

GitLab shipped a fix on June 10, 2026 in versions 18.10.8, 18.11.5 and 19.0.2, though it was not flagged as a security release.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

GitLab uses a helper program to read JSON data when showing changes to Jupyter notebooks. That helper had two memory mistakes: one let an attacker overwrite a function pointer (a stored address the program later jumps to), and the other leaked enough information to bypass a defence that randomises memory addresses. Together they let an ordinary logged-in user run their own code on the GitLab server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by xpert4cyber

View all

11 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.