Critical (AgentArmorHQ estimate)Sandbox escape

mcp-contextforge-gateway has RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server

Product
mcp-contextforge-gateway
CVE
CVE-2026-53710
Affected
mcp-contextforge-gateway <= 1.0.1
Fixed in
1.0.2

Last verified against sources: October 26, 2026

Am I affected?

mcp-contextforge-gateway: affected mcp-contextforge-gateway <= 1.0.1. Fixed in 1.0.2.

  • Check your version: run pip show mcp-contextforge-gateway. Versions <= 1.0.1 of mcp-contextforge-gateway are affected. [1]

What to do now

  1. Upgrade to the fixed version: run pip install --upgrade "mcp-contextforge-gateway>=1.0.2" (first patched version 1.0.2). [1]
  2. Add authentication to HTTP transport for all tools/call requests. [1]

General practice, not from the source: if the affected software could read tokens or credentials, rotate them after upgrading; pin versions and review changes before updating tools your agents run.

Discuss this incident

What happened

  • RestrictedPython's sandbox in ContextForge's python_sandbox_server sub-project allows arbitrary Python execution via three compounding weaknesses. [1]
  • Raw getattr is exposed in safe_builtins, bypassing _getattr_ mediation. [1]
  • validate_code checks for literal dangerous dunder strings, but the payload constructs those names at runtime. [1]
  • The execute_code MCP tool can be exposed over HTTP/SSE transport with no authentication layer. [1]

Impact

  • An attacker with access to the python_sandbox_server HTTP endpoint can execute OS commands with the privileges of the server process. [1]
  • In containerized deployments with host mounts or internal network reachability, this can become filesystem compromise or network pivoting from the gateway host. [1]

What was done

  • pip/mcp-contextforge-gateway affected <= 1.0.1 patched 1.0.2 [1]
  • Remove raw getattr and setattr from safe_builtins. [1]
  • Add authentication to HTTP transport for all tools/call requests. [1]

Sources

  1. GHSA-xm98-3vcf-fph7 — GitHub Advisory Database

Every statement above was checked against these sources before publishing. Spotted an error? Tell us and we will correct it with a dated note.

Share advisory brief with your team

Copy a plain-text summary for Slack, GitHub issues, or team security channels.

Brief
[CVE-2026-53710] mcp-contextforge-gateway has RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server
Product: mcp-contextforge-gateway | Affected: mcp-contextforge-gateway <= 1.0.1 | Fixed in: 1.0.2
Summary: RestrictedPython's sandbox in ContextForge's `python_sandbox_server` sub-project allows arbitrary Python execution via three compounding weaknesses.
Source & remediation on AgentArmorHQ: https://agentarmorhq.com/incidents/2026/08/cve-2026-53710-mcp-contextforge-gateway
Was this page useful?

Corrections

Report an error or request a correction. We review requests within 5 business days and add a dated correction note.

10 to 2,000 characters. A link to a source helps. Stored as plain text.

Discussions for CVE-2026-53710

Ask questions or share configuration tips. Governed by our Community Rules & Terms.

No posts match this filter yet.

Be the first to ask a question or share a working tip.

Check before you install

Paste a package name or a GitHub link and get a clear answer in seconds: Block, Review or No known issues. No account needed.

Check a package

Questions? Contact us