/

CVE-2026-111057

Severity:

CRITICAL RISK

(10.0)

Regex Blocklist Bypass (CWE-185) in Mercury Jupyter

CVE-2026-111057

Deferred

Vulnerability type

Category:

Regular Expression Error

CWE:

CWE-185, CWE-284

Impact:

Unauthenticated Remote Code Execution

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A regular-expression construction error in Mercury causes the anonymous endpoint blocklist to omit effective protection for Jupyter Server's terminal API. An unauthenticated attacker who can reach the exposed endpoint may obtain an interactive operating-system shell, execute commands, and access data available to the Mercury process.

A regular-expression construction error in Mercury causes the anonymous endpoint blocklist to omit effective protection for Jupyter Server's terminal API. An unauthenticated attacker who can reach the exposed endpoint may obtain an interactive operating-system shell, execute commands, and access data available to the Mercury process.

Affected context

The issue affects Mercury deployments in the impacted 3.0.0 through 3.2.4 range when the application exposes Jupyter Server endpoints and relies on BLOCKED_PATTERNS to prevent anonymous access. It becomes risky when the terminal API is network-reachable and the Mercury process has access to sensitive files, credentials, services, or other runtime resources.

The issue affects Mercury deployments in the impacted 3.0.0 through 3.2.4 range when the application exposes Jupyter Server endpoints and relies on BLOCKED_PATTERNS to prevent anonymous access. It becomes risky when the terminal API is network-reachable and the Mercury process has access to sensitive files, credentials, services, or other runtime resources.

Exploit preconditions

  • Attack surface: Network-accessible Mercury or Jupyter Server HTTP endpoints
  • Required access: No authentication, provided the affected endpoint is reachable
  • Trigger point: A request routed to the Jupyter Server terminal API
  • Why exploitation is possible: A missing delimiter concatenates regular-expression patterns, causing the intended endpoint blocklist rule to fail to match the terminal endpoint
  • Additional conditions: The Mercury process must have operating-system permissions and network reachability sufficient for the intended attacker actions
  • Attack surface: Network-accessible Mercury or Jupyter Server HTTP endpoints
  • Required access: No authentication, provided the affected endpoint is reachable
  • Trigger point: A request routed to the Jupyter Server terminal API
  • Why exploitation is possible: A missing delimiter concatenates regular-expression patterns, causing the intended endpoint blocklist rule to fail to match the terminal endpoint
  • Additional conditions: The Mercury process must have operating-system permissions and network reachability sufficient for the intended attacker actions

Why this happens

The vulnerability results from a malformed regular-expression pattern list: two adjacent literals are concatenated because of a missing comma. This changes the matching behavior of the anonymous endpoint blocklist and leaves a security-sensitive route insufficiently protected. The issue maps primarily to CWE-185, Improper Regular Expression, and is also related to CWE-284, Improper Access Control, because the pattern error defeats an intended authorization boundary.

The vulnerability results from a malformed regular-expression pattern list: two adjacent literals are concatenated because of a missing comma. This changes the matching behavior of the anonymous endpoint blocklist and leaves a security-sensitive route insufficiently protected. The issue maps primarily to CWE-185, Improper Regular Expression, and is also related to CWE-284, Improper Access Control, because the pattern error defeats an intended authorization boundary.

Potential impact

  • An unauthenticated attacker may execute operating-system commands
  • The attacker could access files and data available to the Mercury process
  • Application credentials or runtime secrets may be exposed
  • The compromised process may be used for lateral movement or further system abuse
  • Hosted notebooks, dashboards, or connected services may be modified or disrupted
  • An unauthenticated attacker may execute operating-system commands
  • The attacker could access files and data available to the Mercury process
  • Application credentials or runtime secrets may be exposed
  • The compromised process may be used for lateral movement or further system abuse
  • Hosted notebooks, dashboards, or connected services may be modified or disrupted

General mitigation guidance

Mitigation generally focuses on making endpoint authorization explicit rather

than relying solely on deny-pattern matching.

Common defensive patterns include:

  • Prefer explicit allowlists and route-level authorization for administrative and terminal APIs
  • Require authentication and appropriate authorization before exposing interactive server functionality
  • Treat endpoint filters as security-sensitive code and validate each pattern independently
  • Use structured route policies instead of fragile concatenated regular expressions
  • Run Mercury and Jupyter components with least-privilege operating-system and network permissions
  • Reduce process access to secrets, host filesystems, cloud metadata, and unrelated services
  • Apply defense-in-depth controls such as network segmentation and an authenticated reverse proxy

Mitigation generally focuses on making endpoint authorization explicit rather

than relying solely on deny-pattern matching.

Common defensive patterns include:

  • Prefer explicit allowlists and route-level authorization for administrative and terminal APIs
  • Require authentication and appropriate authorization before exposing interactive server functionality
  • Treat endpoint filters as security-sensitive code and validate each pattern independently
  • Use structured route policies instead of fragile concatenated regular expressions
  • Run Mercury and Jupyter components with least-privilege operating-system and network permissions
  • Reduce process access to secrets, host filesystems, cloud metadata, and unrelated services
  • Apply defense-in-depth controls such as network segmentation and an authenticated reverse proxy

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and review rules that inspect security-sensitive regular-expression lists for missing delimiters or implicit string concatenation
  • Tests asserting that every protected endpoint is denied without authentication
  • Route and authorization inventory reviews for Jupyter Server administrative or terminal APIs
  • Integration tests covering anonymous requests to all blocked paths and near-matching paths
  • Web-server logs showing unauthenticated requests to terminal endpoints or unusual terminal-session activity
  • Policy enforcement requiring authentication at an independent proxy or gateway layer

Automated code-review and security-testing tools may help identify malformed patterns and missing authorization coverage.

Organizations can look for this class of issue through:

  • Static analysis and review rules that inspect security-sensitive regular-expression lists for missing delimiters or implicit string concatenation
  • Tests asserting that every protected endpoint is denied without authentication
  • Route and authorization inventory reviews for Jupyter Server administrative or terminal APIs
  • Integration tests covering anonymous requests to all blocked paths and near-matching paths
  • Web-server logs showing unauthenticated requests to terminal endpoints or unusual terminal-session activity
  • Policy enforcement requiring authentication at an independent proxy or gateway layer

Automated code-review and security-testing tools may help identify malformed patterns and missing authorization coverage.

Sources

SourceLink
github.comgithub.com/mljar/mercury/commit/8c467129037ee9df269d543ac217ffd33b97bf3f
github.comgithub.com/mljar/mercury/releases/tag/v3.2.4
github.comgithub.com/mljar/mercury/security/advisories/GHSA-f8c7-rwf9-fmgm

Frequently asked

questions

Yes, when the affected Mercury or Jupyter Server endpoint is reachable over a

network. The request does not require authentication if the anonymous route

handling is exposed and affected by the malformed blocklist.

The attacker generally needs only network connectivity to the exposed service.

They do not need valid application credentials, although network controls may

limit reachability.

Use explicit, authenticated authorization for terminal and other administrative

APIs, and avoid relying on fragile denylist regular expressions as the primary

security boundary.

Treat route filters as security-critical code, test each protected endpoint

anonymously and with authorized access, use structured allowlists, and apply

independent gateway and least-privilege controls.

Yes, when the affected Mercury or Jupyter Server endpoint is reachable over a

network. The request does not require authentication if the anonymous route

handling is exposed and affected by the malformed blocklist.

The attacker generally needs only network connectivity to the exposed service.

They do not need valid application credentials, although network controls may

limit reachability.

Use explicit, authenticated authorization for terminal and other administrative

APIs, and avoid relying on fragile denylist regular expressions as the primary

security boundary.

Treat route filters as security-critical code, test each protected endpoint

anonymously and with authorized access, use structured allowlists, and apply

independent gateway and least-privilege controls.

Find out what's already
exploitable in your codebase.