PyPI: mercury

CVE-2026-111057

Safety vulnerability ID: SFTY-20261019-31507

Affected versions of the `mercury` package are vulnerable to Missing Authentication for Critical Function due to a missing comma in the endpoint blocklist that leaves the Jupyter terminal API reachable without authentication. In `mercury_app/block_handler.py`, the `/lab` pattern and the `/api/terminals` pattern of `BLOCKED_PATTERNS` have no comma between them, so Python joins the two strings into a single regular expression that matches neither endpoint on its own, and a direct request to `/api/terminals` reaches Jupyter Server's built-in terminal handler on a server that runs with an empty token by default. An unauthenticated attacker who can reach a Mercury server can send `POST /api/terminals` to spawn a terminal and then connect to its websocket to run arbitrary operating system commands with the privileges of the Mercury process, gaining full control of the host or container.

Created at: Oct 20, 2026Updated at: Oct 20, 2026

Overview

Mercury: Unauthenticated Remote Code Execution in /api/terminals - access control bypass

Advisory

mercury – Missing Authentication for Critical Function

Affected Package

Affecting mercury package, versions>= 3.0.0, <= 3.2.3

Also affects

---

How to Fix

Upgrademercuryto3.2.4or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more