/

CVE-2026-81096

Severity:

CRITICAL RISK

(10.0)

Python Sandbox Escape (CWE-94) in ToolUniverse Server

CVE-2026-81096

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

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

ToolUniverse exposed a Python execution tool whose sandbox checks could be bypassed, allowing callers to run arbitrary code as the server process. The risk was especially severe when the HTTP or MCP server was reachable without authentication and bound to a non-loopback interface.

Affected context

The vulnerability occurs in deployments that expose ToolUniverse's Python executor through its HTTP or MCP server without effective authentication. Risk increases when the service listens on all network interfaces, permits caller-controlled changes to import settings, or relies on deny-list checks to constrain Python attribute access. Exploitation depends on network reachability and execution occurring with the privileges of the server process.

Exploit preconditions

  • Attack surface: The HTTP or MCP endpoint exposing the Python code executor - Required access: Network access to the service; authentication was not required - Trigger point: Submission of Python source and executor arguments - Why exploitation is possible: Incomplete attribute restrictions and

caller-controlled import expansion allowed sandbox boundary bypasses, while

exposed unauthenticated listeners made the executor reachable by arbitrary

callers

Why this happens

The underlying flaw was an incomplete Python sandbox implementation mapped to CWE-94, Improper Control of Generation of Code. The executor relied on a deny-list of names and calls but left reflective attribute-lookup capabilities available. This allowed restricted objects to be reached indirectly through string-based lookups or permitted modules. A per-call import setting could also widen the allowed module set before inspection, weakening the intended trust boundary. Network exposure and absent authentication compounded the code-execution risk.

Potential impact

  • An attacker could execute arbitrary Python or operating-system operations
  • The attacker could compromise the ToolUniverse server process
  • Confidential data accessible to that process could be disclosed
  • Server credentials, tokens, or connected service access could be abused
  • The host or surrounding environment could be used for lateral movement
  • Service availability and integrity could be disrupted

General mitigation guidance

Mitigation generally centers on avoiding in-process execution of untrusted Python and treating sandboxing as defense in depth rather than a complete security boundary. Secure-by-default patterns include requiring strong authentication and authorization, binding administrative services to a restricted interface, removing caller control over import policy, and using a capability-based execution model instead of deny-list filtering. Where execution is unavoidable, isolation should use a separately constrained worker with least privilege, restricted filesystem and network access, resource limits, and minimal credentials. Input validation should occur before execution, and debugging interfaces should not be enabled in exposed environments.

How teams detect issues like this

Detection can include static analysis for dynamic execution APIs, reflective attribute access, permissive import controls, and deny-list-only sandbox designs. Code review should examine whether user-controlled arguments can alter policy before validation and whether server defaults expose listeners without authentication. Runtime monitoring can alert on unexpected child processes, module loading, filesystem access, or outbound connections from executor workers. Policy enforcement may require authentication, restricted bind addresses, disabled debugging, and least-privilege service identities. Automated security review tools can help identify these patterns in pull requests and dependency configurations.

Sources

SourceLink
github.comgithub.com/mims-harvard/ToolUniverse
github.comgithub.com/mims-harvard/ToolUniverse/pull/251
github.comgithub.com/mims-harvard/ToolUniverse/security/advisories/GHSA-pxwq-22vf-87fm
vulncheck.comvulncheck.com/advisories/tooluniverse-through-1.2.6-unauthenticated-remote-code-execution-via-python-code-executor-sandbox-escape

Frequently asked

questions

It can be remotely exploitable when an HTTP or MCP server exposes the Python

executor on a reachable interface without authentication. A caller still

needs network access to the service.

Not when the affected server is deployed without authentication. In

authenticated deployments, access would depend on the endpoint's authorization

controls and whether they distinguish trusted users from untrusted callers.

The safest pattern is to avoid executing caller-supplied Python in the server

process. If execution is required, use a separately isolated, least-privileged

worker with strict authentication, fixed capabilities, and resource and

network restrictions.

Do not rely solely on deny-lists to secure dynamic language execution. Remove

caller control over security policy, validate inputs before execution, keep

services private by default, disable debugging on exposed systems, and apply

continuous static and runtime security checks.

Find out what's already
exploitable in your codebase.