Vulnerability  ·  2026-09-16

MCP Context Forge python_sandbox_server — RestrictedPython sandbox escape to full RCE

VulnerabilityHigh impactGlobalCVE-2026-53710
ContextForge's Python code-execution sandbox for MCP tool calls can be escaped via runtime-constructed dunder attribute names and an exposed raw getattr builtin, allowing arbitrary code execution rather than the restricted subset the sandbox is meant to enforce.
MCP Context Forge is positioned as a centralized AI gateway/registry/proxy for MCP, A2A, and REST/gRPC APIs; a sandbox escape in its code-execution tool converts what operators believe is a safely restricted 'run some Python' capability for agents into unauthenticated remote code execution on the gateway itself, with a public PoC already available.
The sandbox exposes raw getattr through safe_builtins (bypassing mediated attribute access), and code-validation only checks for literal dangerous dunder strings while allowing them to be constructed at runtime. Combined with the execute_code MCP tool being reachable over unauthenticated HTTP/SSE transport, an attacker can submit Python that dynamically reconstructs blocked names (e.g. to reach subprocess/Popen) and execute arbitrary OS commands with the server process's privileges. A working proof-of-concept has been published.
IBM/mcp-context-forge python_sandbox_server sub-project, prior to 1.0.2/1.0.3
Upgrade mcp-context-forge / python_sandbox_server to the patched release (1.0.2 or later per the referenced fix commit); require authentication on the execute_code MCP tool and restrict network reachability of the sandbox server regardless of patch status.
NVDGitHub Commit
See this in the live feed Explore related AI security and governance findings — updated every morning.
Open the feed →