Skip to main content
Vulnerability Database/CVE-2026-111057

CVE-2026-111057: Mercury Framework Auth Bypass Vulnerability

CVE-2026-111057 is an authentication bypass flaw in Mercury framework that allows unauthenticated attackers to access terminal APIs and execute system commands. This post covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111057 Overview

CVE-2026-111057 is an authentication bypass vulnerability in Mercury, a Python framework that publishes Jupyter notebooks as web applications and dashboards. The flaw affects versions 3.0.0 through 3.2.3 and is fixed in version 3.2.4. A missing comma in the BLOCKED_PATTERNS list concatenates two regular-expression literals, causing requests to /api/terminals to bypass the anonymous endpoint blocklist. Unauthenticated attackers reach Jupyter Server's terminal API and obtain an interactive operating-system shell running as the Mercury process. The vulnerability is categorized under [CWE-185] Incorrect Regular Expression.

Critical Impact

Unauthenticated network attackers gain an interactive OS shell on the Mercury host, enabling arbitrary command execution and access to all data readable by the Mercury process.

Affected Products

  • Mercury (mljar/mercury) versions 3.0.0 through 3.2.3
  • Jupyter notebook dashboards exposed through Mercury
  • Any deployment using Mercury's anonymous endpoint blocklist for terminal protection

Discovery Timeline

  • 2026-10-19 - CVE-2026-111057 published to NVD
  • 2026-10-19 - Last updated in NVD database
  • v3.2.4 - mljar releases patched version of Mercury

Technical Details for CVE-2026-111057

Vulnerability Analysis

Mercury maintains a BLOCKED_PATTERNS list of regular expressions in mercury_app/block_handler.py to prevent anonymous users from reaching sensitive Jupyter Server endpoints. The list enumerates paths such as /lab, /api/terminals, /api/shutdown, and /files. A missing comma between the /lab pattern and the /api/terminals pattern caused Python to apply implicit string concatenation. The two separate regex literals merged into one, and the /api/terminals pattern silently disappeared from the enforced blocklist. Requests to /api/terminals then flowed through to Jupyter Server, which exposes an interactive terminal API returning a full operating-system shell.

Root Cause

The root cause is a syntax-level error in a Python list literal, which Python's implicit string concatenation turns into a functional security defect. Because the parser silently joins adjacent string literals, no runtime error flagged the issue and the blocklist still appeared well-formed. This is a textbook [CWE-185] Incorrect Regular Expression condition, where the pattern actually compiled does not match the pattern the developer intended.

Attack Vector

An unauthenticated remote attacker sends an HTTP request to /api/terminals on an exposed Mercury instance. Jupyter Server allocates a terminal session and returns a WebSocket endpoint. The attacker connects, issues shell commands as the Mercury process user, reads notebook source and data files, pivots to adjacent systems, or installs persistence.

python
# Patch from mercury_app/block_handler.py
# Source: https://github.com/mljar/mercury/commit/8c467129037ee9df269d543ac217ffd33b97bf3f

BLOCKED_PATTERNS = [
    # JupyterLab UI + API
-    r"/lab(?!/(?:extensions/|api/settings(?:/|$)|api/translations(?:/|$)))(?:/.*)?"
+    r"/lab(?!/(?:extensions/|api/settings(?:/|$)|api/translations(?:/|$)))(?:/.*)?",
    r"/api/terminals(?:/.*)?",
    r"/api/shutdown(?:/.*)?",
    r"/files(?:/.*)?",

The fix adds the missing trailing comma after the /lab regex so that /api/terminals is restored as a separate, enforced blocklist entry. Mercury's __init__.py version string is incremented from 3.2.3 to 3.2.4 in the same commit.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-111057

Indicators of Compromise

  • HTTP requests to /api/terminals or /api/terminals/websocket/* on a Mercury host from unauthenticated or unexpected source addresses
  • New terminal session identifiers created in Jupyter Server logs without a corresponding authenticated user context
  • Child processes of the Mercury or Jupyter Server process spawning shells such as /bin/sh, /bin/bash, or cmd.exe
  • Outbound network connections initiated from the Mercury process to attacker-controlled infrastructure

Detection Strategies

  • Inspect reverse-proxy and web server access logs for POST, GET, or WebSocket upgrades targeting /api/terminals paths.
  • Monitor process trees for shell processes whose parent is the Python interpreter running Mercury or Jupyter Server.
  • Alert on unexpected file reads of notebook files (*.ipynb), credentials, or dataset directories by the Mercury service account.
  • Correlate /api/terminals traffic with any absence of Mercury authentication events in the same session.

Monitoring Recommendations

  • Deploy endpoint telemetry on hosts running Mercury to capture process execution and command-line arguments.
  • Enable Jupyter Server access logging at a verbosity that records request paths and WebSocket upgrades.
  • Baseline normal Mercury URL patterns and alert on deviations, especially to /api/* endpoints that are not notebook rendering routes.

How to Mitigate CVE-2026-111057

Immediate Actions Required

  • Upgrade Mercury to version 3.2.4 or later on every host running the framework.
  • Audit /api/terminals access in historical logs covering the full window the vulnerable version was deployed.
  • Rotate any credentials, API tokens, or SSH keys readable by the Mercury process account if post-exploitation activity cannot be ruled out.
  • Restrict network exposure of Mercury to trusted networks or place it behind an authenticating reverse proxy.

Patch Information

The fix is published in GitHub Release v3.2.4 and documented in GitHub Security Advisory GHSA-f8c7-rwf9-fmgm. The code change is visible in the GitHub Commit Record, which restores the missing comma in BLOCKED_PATTERNS and bumps the version string in mercury/__init__.py.

Workarounds

  • Block /api/terminals and /api/terminals/* at an upstream reverse proxy such as nginx, HAProxy, or a web application firewall.
  • Disable the Jupyter Server terminal extension by starting the server with terminals disabled where possible.
  • Enforce network-level authentication (mutual TLS, VPN, or SSO proxy) in front of Mercury until the upgrade is deployed.
bash
# Example nginx block to deny unauthenticated terminal access
location ~ ^/api/terminals(/.*)?$ {
    return 403;
}

# Verify installed Mercury version after upgrade
pip show mercury | grep -i version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.