Back to Intelligence

GitLab v18.11.3 Critical RCE: Detection and Hardening for Jupyter Diff Flaw

SA
Security Arsenal Team
July 25, 2026
6 min read

Introduction

Security researchers have released a proof-of-concept (PoC) exploit for a critical Remote Code Execution (RCE) vulnerability affecting self-managed GitLab instances, specifically version 18.11.3. Published by Yuhang Wu of depthfirst, this flaw allows an ordinary authenticated user to execute arbitrary commands on the underlying server as the git user.

The severity of this issue cannot be overstated. Unlike many vulnerabilities requiring administrative privileges or Continuous Integration (CI) runner access, this exploit chain requires only a standard user account. By committing two crafted Jupyter notebooks and requesting a diff, an attacker can trigger the vulnerability with zero victim interaction and no special permissions beyond basic project access. For defenders, this represents a critical gap in input validation within the application's rendering logic.

Technical Analysis

Affected Products:

  • GitLab Self-Managed: Version 18.11.3 is explicitly confirmed as vulnerable in the PoC release.

Vulnerability Mechanics: The vulnerability resides in how GitLab processes differences (diffs) for Jupyter Notebook files (.ipynb). Jupyter notebooks are structured JSON documents. When GitLab renders a diff between two versions of a notebook, it parses the JSON to visualize cell changes.

The attack chain is as follows:

  1. Initial Access: An attacker authenticates to the GitLab instance with any non-admin account (e.g., a developer account).
  2. Preparation: The attacker creates two specifically crafted Jupyter notebooks containing malicious payloads within the JSON structure.
  3. Trigger: The attacker pushes these files to a repository and requests a diff view via the web UI or API.
  4. Exploitation: The server-side component responsible for rendering the Jupyter diff fails to properly sanitize the input. This triggers an injection or deserialization flaw, executing the attacker's command.
  5. Impact: Commands execute with the permissions of the git service account.

Defensive Considerations: While the git user is not root, it typically has read/write access to all repository data, potentially allowing an attacker to exfiltrate source code, modify repositories to inject supply chain malware (poisoning pipelines), or pivot laterally if local privilege escalation vulnerabilities exist on the host.

Detection & Response

Given the availability of a working PoC, security teams must assume active scanning or exploitation attempts are imminent. The following detection mechanisms focus on the anomalous behavior of the git user, which should rarely, if ever, spawn interactive shells or system utilities directly.

SIGMA Rules

YAML
---
title: GitLab RCE - Git User Spawning Shell
id: 8a4b2c1d-9e6f-4a3b-8c5d-1e2f3a4b5c6d
status: experimental
description: Detects the git user spawning interactive shells or utilities, indicative of successful RCE on GitLab servers.
references:
  - https://thehackernews.com/2026/07/researcher-publishes-gitlab-rce-poc.html
author: Security Arsenal
date: 2026/07/15
tags:
  - attack.execution
  - attack.t1059.004
logsource:
  product: linux
  category: process_creation
detection:
  selection:
    User|contains: 'git'
    Image|endswith:
      - '/bash'
      - '/sh'
      - '/zsh'
      - '/python'
      - '/perl'
      - '/nc'
      - '/curl'
  condition: selection
falsepositives:
  - Legitimate administrative debugging by git user (rare)
level: critical
---
title: GitLab RCE - GitLab-Workhorse Spawning System Commands
id: 9c5d3e2f-0a7g-5b4c-9d6e-2f3a4b5c6d7e
status: experimental
description: Detects the main GitLab web process spawning suspicious child processes often used in post-exploitation.
references:
  - https://thehackernews.com/2026/07/researcher-publishes-gitlab-rce-poc.html
author: Security Arsenal
date: 2026/07/15
tags:
  - attack.execution
  - attack.t1059
logsource:
  product: linux
  category: process_creation
detection:
  selection_parent:
    ParentImage|contains:
      - '/gitlab-workhorse'
      - '/gitaly'
  selection_child:
    Image|endswith:
      - '/bash'
      - '/sh'
      - '/wget'
  condition: all of selection_*
falsepositives:
  - Authorized administrative scripts
level: high

KQL (Microsoft Sentinel / Defender)

Hunt for suspicious process execution originating from the git user or GitLab parent processes on Linux endpoints monitored by Microsoft Defender for Endpoint.

KQL — Microsoft Sentinel / Defender
DeviceProcessEvents
| where Timestamp > ago(7d)
| where AccountName contains "git"
| where ProcessCommandLine contains "-c" or 
   ProcessVersionInfoOriginalFileName in ("bash.exe", "sh.exe", "python.exe", "perl.exe") or
   FileName in ("bash", "sh", "zsh", "python", "perl", "nc", "curl", "wget")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
| order by Timestamp desc

Velociraptor VQL

VQL — Velociraptor
-- Hunt for processes running as the git user that are not standard git operations
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE Username =~ 'git'
  AND Name NOT IN ('git', 'git-remote-http', 'git-remote-https', 'git-credential-cache', 'sshd')
  AND Name =~ '(bash|sh|zsh|python|perl|nc|curl|wget|chmod|chown)'

Remediation Script (Bash)

Use this script to audit your GitLab instance for the vulnerable version and verify the status of the git user.

Bash / Shell
#!/bin/bash

# GitLab Hardening and Version Check Script
# Checks for version 18.11.3 and lists active git user processes

echo "[*] Checking GitLab Version..."
# Attempt to retrieve version using gitlab-rake or checking the VERSION file
if [ -f "/opt/gitlab/embedded/service/gitlab-rails/VERSION" ]; then
    CURRENT_VERSION=$(cat /opt/gitlab/embedded/service/gitlab-rails/VERSION)
    echo "Detected GitLab Version: $CURRENT_VERSION"
    
    if [ "$CURRENT_VERSION" == "18.11.3" ]; then
        echo "[!] CRITICAL: This instance is running a vulnerable version (18.11.3)."
        echo "[!] Action Required: Patch immediately to the latest secure version."
    else
        echo "[+] Version does not match the specific vulnerable release 18.11.3."
    fi
else
    echo "[-] Could not automatically determine version. Please verify manually."
fi

echo ""
echo "[*] Auditing processes running as 'git' user..."
# Check for suspicious shells or tools running as git
SUSPICIOUS_PROCS=$(ps -u git -o pid,comm,args | grep -E '(bash|sh|zsh|python|perl|nc|curl|wget)' | grep -v grep)

if [ -n "$SUSPICIOUS_PROCS" ]; then
    echo "[!] WARNING: Found non-standard processes running as git user:"
    echo "$SUSPICIOUS_PROCS"
    echo "[!] Investigate these PIDs immediately."
else
    echo "[+] No suspicious shells or utilities detected for git user."
fi

echo "[*] Remediation Recommendation:"
echo "1. Upgrade GitLab to the latest patched release available at https://about.gitlab.com/releases/"
echo "2. If immediate patching is impossible, consider restricting Jupyter notebook rendering or diff capabilities via application configuration (if supported)."

Remediation

  1. Patch Immediately: Upgrade self-managed GitLab instances to the latest version available. While version 18.11.3 is explicitly targeted in the PoC, review the official GitLab security advisory for the full scope of affected versions and apply the necessary updates.
  2. Review Access Logs: Audit GitLab access logs (gitlab-rails/log/gitlab_rails production.log and nginx/gitlab_access.log) for anomalies around Jupyter notebook interactions or unusually large diff requests leading up to the patch deployment.
  3. Restrict User Registration: Ensure that registration is restricted to authorized domains only. While this requires an authenticated user, preventing open registration reduces the attack surface.
  4. Least Privilege for git User: Ensure the OS-level git user does not have sudo privileges or unnecessary write access to system binaries outside of the repository data paths.

Official References

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

criticalzero-daycvepatch-tuesdayexploitvulnerability-disclosuregitlabrcejupyterdevsecops

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.