CVE-2026-111057
Unauthenticated bypass of blocklist allows terminal API access, leading to OS command execution.
- CVSS 10.0
- CWE-185
- Authentication, Authorization, and Session Management
- Remote
Mercury is a Python framework for sharing Jupyter notebooks as web applications and dashboards. From 3.0.0 until 3.2.4, a missing comma in BLOCKED_PATTERNS concatenates the /lab and /api/terminals regular-expression literals. Requests to /api/terminals therefore bypass the anonymous endpoint blocklist and reach Jupyter Server's terminal API. An unauthenticated attacker can use the resulting interactive operating-system shell to execute commands and access data available to the Mercury process. This issue is fixed in version 3.2.4.
- CWE
- CWE-185
- CVSS base score
- 10.0
- Published
- 2026-10-19
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- 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.4 or later.
Vulnerable code sample
import re
# Mercury endpoint blocklist
BLOCKED_PATTERNS = [
r"^/lab" # VULNERABLE: missing comma causes regex concatenation
r"^/api/terminals",
]
def is_blocked(path: str) -> bool:
"""Return True if the request path matches any blocked pattern."""
for pat in BLOCKED_PATTERNS:
if re.match(pat, path):
return True
return False
def handle_request(path: str):
if is_blocked(path):
raise PermissionError("Anonymous access denied")
# Normal request handling continues here
return f"Handled {path}"Patched code sample
import re
# Mercury endpoint blocklist
BLOCKED_PATTERNS = [
r"^/lab", # FIX: added missing comma to separate patterns
r"^/api/terminals",
]
def is_blocked(path: str) -> bool:
"""Return True if the request path matches any blocked pattern."""
for pat in BLOCKED_PATTERNS:
if re.match(pat, path):
return True
return False
def handle_request(path: str):
if is_blocked(path):
raise PermissionError("Anonymous access denied")
# Normal request handling continues here
return f"Handled {path}"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.
- fix: block unauthenticated terminal access (mljar/mercury)
mercury/__init__.py,mercury_app/block_handler.py
Cite this entry
@misc{vaitp:cve2026111057,
title = {{Unauthenticated bypass of blocklist allows terminal API access, leading to OS command execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-111057},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-111057/}}
}
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 ::
