VAITP Dataset

← Back to the dataset

CVE-2026-111058

Tokenless Mercury < 3.2.6 allows unauthenticated users to spawn kernels and run arbitrary Python code.

  • CVSS 9.8
  • CWE-862
  • Authentication, Authorization, and Session Management
  • Remote

Mercury is a Python framework for sharing Jupyter notebooks as web applications and dashboards. Prior to 3.2.6, default tokenless deployments allow anonymous clients to create Jupyter kernels and send execute_request messages containing arbitrary Python. The endpoint blocklist does not cover /api/kernels, and the websocket wrapper previously tracked idle activity without authorizing executable messages. This issue is fixed in version 3.2.6.

CVSS base score
9.8
Published
2026-10-19
OWASP
A03 Injection
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Authentication, Authorization, and Session Management
Subcategory
Privilege Escalation
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Mercury
Fixed by upgrading
Yes

Solution

Upgrade Mercury to version 3.2.6 or later.

Vulnerable code sample

from mercury.web import WebApp, route
from jupyter_client import KernelManager

app = WebApp()

@route("/api/kernels")
def create_kernel(request):
    # VULNERABLE: no authentication check allows anonymous kernel creation
    km = KernelManager()
    km.start_kernel()
    return {"kernel_id": km.kernel_id}

Patched code sample

from mercury.web import WebApp, route, HTTPError
from jupyter_client import KernelManager

app = WebApp()

@route("/api/kernels")
def create_kernel(request):
    # FIX: enforce authentication before creating a kernel
    if not getattr(request, "user", None) or not request.user.is_authenticated:
        raise HTTPError(403, "Authentication required")
    km = KernelManager()
    km.start_kernel()
    return {"kernel_id": km.kernel_id}

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • Secure anonymous kernel execution (mljar/mercury)
    mercury_app/app.py, mercury_app/app.py · MercuryApp.initialize, mercury_app/app.py · MercuryApp.initialize_handlers, mercury_app/app.py · MercuryApp.initialize_settings, mercury_app/block_handler.py, mercury_app/notebook_sanitize.py, mercury_app/notebook_sanitize.py · sanitize_notebook_for_mercury_runtime, mercury_app/__main__.py · _parse_and_inject

Cite this entry

@misc{vaitp:cve2026111058,
  title        = {{Tokenless Mercury < 3.2.6 allows unauthenticated users to spawn kernels and run arbitrary Python code.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-111058},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-111058/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.