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.
Overview
Mercury: Unauthenticated Remote Code Execution in /api/terminals - access control bypass
Advisory
mercury – Missing Authentication for Critical Function
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20261019-31507/CVE-2026-111057
- https://github.com/mljar/mercury/security/advisories/GHSA-f8c7-rwf9-fmgm
- https://github.com/mljar/mercury/commit/8c467129037ee9df269d543ac217ffd33b97bf3f
- https://github.com/mljar/mercury/releases/tag/v3.2.4
- https://github.com/advisories/GHSA-f8c7-rwf9-fmgm
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
