Summary
CVE-2026-53710 is a critical remote code execution vulnerability in the python_sandbox_server component of IBM’s ContextForge MCP Gateway (mcp-contextforge-gateway). Three compounding weaknesses — an unmediated getattr in the sandbox’s safe builtins, weak literal-string validation, and an unauthenticated HTTP/SSE endpoint — allow a remote, unauthenticated attacker to escape the RestrictedPython sandbox and execute arbitrary OS commands with the privileges of the server process. The flaw carries a maximum CVSS v3.1 base score of 10.0.
Technical details
- Root cause: The sandbox’s
safe_builtinsexpose the rawgetattr/setattrfunctions, bypassing RestrictedPython’s intended_getattr_attribute-access mediation. - Validation weakness: Code submitted for execution is checked against a list of literal dangerous dunder strings (e.g.,
__class__,__subclasses__), but an attacker can construct these attribute names dynamically at runtime (e.g., via string concatenation), evading the filter entirely. - Exploitation path: Using unmediated
getattrplus dynamically built dunder names, an attacker can traverse the Python class hierarchy from any object, reachsubprocess.Popen(or equivalent), and execute arbitrary OS commands. - Attack vector: The
execute_codeMCP tool exposed bypython_sandbox_servercan be reachable over HTTP/SSE transport with no authentication layer, so any network client that can reach the endpoint can submit a malicious payload via atools/callrequest. - Impact: Full compromise of confidentiality, integrity, and availability — arbitrary command execution at server-process privilege, which can lead to filesystem compromise or lateral network movement in containerized/networked deployments.
Affected software
- IBM
mcp-contextforge-gateway(ContextForge MCP Gateway), all releases up to and including 1.0.1, including the 0.x series and 1.0.0 pre-release/beta/RC builds, when thepython_sandbox_servercomponent’sexecute_codetool is exposed over an unauthenticated HTTP/SSE transport.
Severity
- CVSS v3.1 Base Score: 10.0 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: Upgrade
mcp-contextforge-gatewayto version 1.0.2 or later, which removes the unmediatedgetattr/setattrexposure, replaces literal-string filtering with RestrictedPython’s stricter policy pipeline, and adds authentication totools/callHTTP requests. - If patching is not immediately possible:
- Do not expose the
python_sandbox_server/execute_codetool over HTTP or SSE transport to untrusted networks. - Restrict deployment of the sandbox server to stdio-only transport where feasible.
- Place any HTTP-exposed sandbox endpoints behind an authentication layer and network access controls (firewall/allowlist) until upgraded.
- Note that IBM has since removed the sample Python Sandbox Server MCP server from the project entirely as it will not continue to be maintained; organizations relying on it should migrate away from this component.
- Do not expose the

