CVE-2026-53710: Mcp contextforge gateway Mcp-contextforge-gateway Has RestrictedPython Sandbox Bypass Vulnerability

CRITICAL
Advisory Identifier: GHSA-xm98-3vcf-fph7
CVSS 10.0
CWE-693 CWE-94
Published
Advisory Summary

CVE-2026-53710 is a CRITICAL (CVSS 10.0) mcp-contextforge-gateway has restrictedpython sandbox bypass vulnerability (CWE-693: Protection Mechanism Failure) affecting Mcp contextforge gateway libraries in the PyPI ecosystem. The issue involves mcp-contextforge-gateway has restrictedpython sandbox bypass via getattr builtin in python_sandbox_server. Remediation is available by upgrading affected packages to version 1.0.2.

CVE-2026-53710 at a Glance

CVE Identifier CVE-2026-53710
GHSA Identifier GHSA-xm98-3vcf-fph7
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-693: Protection Mechanism Failure
Affected Product Mcp contextforge gateway
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-53710

To remediate this vulnerability, upgrade all affected Mcp contextforge gateway dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mcp-contextforge-gateway fixed: 1.0.2
pip install mcp-contextforge-gateway>=1.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show mcp-contextforge-gateway

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-53710, inspect your installed packages using pip:

pip show mcp-contextforge-gateway

Analyze the terminal output to locate any version of Mcp contextforge gateway in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.2), your application is affected.

Note: The pip show mcp-contextforge-gateway command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. In Mcp contextforge gateway, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Commit:** `f855e54d5b7bc1c91b977574a03b91eff6b86bb6` **Component:** `mcp-servers/python/python_sandbox_server/src/python_sandbox_server/server_fastmcp.py` ## Vulnerability 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. 2. `validate_code` checks for literal dangerous dunder strings, but the payload constructs those names at runtime. 3. The `execute_code` MCP tool can be exposed over HTTP/SSE transport with no authentication layer. ## Proof of Concept The local PoC was executed against the real pinned sandbox code path. It constructs dunder names at runtime, walks Python's class hierarchy through the exposed `getattr`, finds `subprocess.Popen`, and executes a harmless marker command. Transcript excerpt: ```text POC: IBM/mcp-context-forge RestrictedPython getattr sandbox bypass validation={'valid': True, 'message': 'Code passed validation', 'warnings': None} success=True stdout="FOUND_POPEN\nb'IBM_SANDBOX_POC_PASS'\n" IBM_RESTRICTEDPYTHON_GETATTR_POPEN_REPRO_PASS ``` PoC artifact hashes: ```text beb2d856c5a1b7c10005c9c0fccaf3d491d4fbcc2a69bc54b5e95c5730c0874b run.py 1037dcb4f0831a3c96ca728527f939af1d3e19514b23ef54f663707875748ff8 run.sh 7026e676ee31916886f10feed959ffdbe486fda05b17421387e4717acbf90ba6 transcript.txt ``` ## Production Deployment Context ContextForge's documentation describes registering MCP servers as gateways in a running ContextForge instance. If this sandbox server is reachable over HTTP in that pattern, any client that can reach the endpoint can submit the payload through `tools/call`. ## Impact An attacker with access to the `python_sandbox_server` HTTP endpoint can execute OS commands with the privileges of the server process. In containerized deployments with host mounts or internal network reachability, this can become filesystem compromise or network pivoting from the gateway host. ## Suggested Fix Remove raw `getattr` and `setattr` from `safe_builtins`, expose only policy-controlled attribute access if dynamic lookup is required, replace substring filtering with a stricter RestrictedPython policy pipeline, and add authentication to HTTP transport for all `tools/call` requests. ## Caveats This report covers the `python_sandbox_server` sub-project. The core ContextForge gateway and proxy components are not directly affected. The Critical score assumes HTTP reachability; stdio-only deployments reduce the attack vector.

CVE-2026-53710 Affected Mcp contextforge gateway Versions

1 component(s)
Fixed Versions:
1.0.2
Product / Package Ecosystem Affected Versions Fixed Version
mcp-contextforge-gateway
PyPI
< 1.0.2
1.0.2

References

Frequently Asked Questions

What is CVE-2026-53710?
CVE-2026-53710 is a security vulnerability in Mcp contextforge gateway involving mcp-contextforge-gateway has RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server under CWE-693: Protection Mechanism Failure.
Which Mcp contextforge gateway versions are affected?
Affected versions include releases prior to 1.0.2 across affected packages: mcp-contextforge-gateway.
What version fixes CVE-2026-53710?
Upgrading to 1.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mcp-contextforge-gateway affected?
Yes, mcp-contextforge-gateway is affected in releases prior to 1.0.2. Upgrade your dependency to 1.0.2 or later.
What is the CVSS score of CVE-2026-53710?
CVE-2026-53710 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-53710?
CVE-2026-53710 is classified under CWE-693: Protection Mechanism Failure (The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.).
How can I check PyPI dependencies for CVE-2026-53710?
Run the dependency tree command: 'pip show mcp-contextforge-gateway'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xm98-3vcf-fph7",
  "modified" : "2026-09-02T15:28:19Z",
  "published" : "2026-08-24T19:20:58Z",
  "aliases" : [ "CVE-2026-53710" ],
  "summary" : "mcp-contextforge-gateway has RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server",
  "details" : "**Commit:** `f855e54d5b7bc1c91b977574a03b91eff6b86bb6`\n**Component:** `mcp-servers/python/python_sandbox_server/src/python_sandbox_server/server_fastmcp.py`\n\n## Vulnerability\n\nRestrictedPython's sandbox in ContextForge's `python_sandbox_server` sub-project allows arbitrary Python execution via three compounding weaknesses:\n\n1. Raw `getattr` is exposed in `safe_builtins`, bypassing `_getattr_` mediation.\n2. `validate_code` checks for literal dangerous dunder strings, but the payload constructs those names at runtime.\n3. The `execute_code` MCP tool can be exposed over HTTP/SSE transport with no authentication layer.\n\n## Proof of Concept\n\nThe local PoC was executed against the real pinned sandbox code path. It constructs dunder names at runtime, walks Python's class hierarchy through the exposed `getattr`, finds `subprocess.Popen`, and executes a harmless marker command.\n\nTranscript excerpt:\n\n```text\nPOC: IBM/mcp-context-forge RestrictedPython getattr sandbox bypass\nvalidation={'valid': True, 'message': 'Code passed validation', 'warnings': None}\nsuccess=True\nstdout=\"FOUND_POPEN\\nb'IBM_SANDBOX_POC_PASS'\\n\"\nIBM_RESTRICTEDPYTHON_GETATTR_POPEN_REPRO_PASS\n```\n\nPoC artifact hashes:\n\n```text\nbeb2d856c5a1b7c10005c9c0fccaf3d491d4fbcc2a69bc54b5e95c5730c0874b  run.py\n1037dcb4f0831a3c96ca728527f939af1d3e19514b23ef54f663707875748ff8  run.sh\n7026e676ee31916886f10feed959ffdbe486fda05b17421387e4717acbf90ba6  transcript.txt\n```\n\n## Production Deployment Context\n\nContextForge's documentation describes registering MCP servers as gateways in a running ContextForge instance. If this sandbox server is reachable over HTTP in that pattern, any client that can reach the endpoint can submit the payload through `tools/call`.\n\n## Impact\n\nAn attacker with access to the `python_sandbox_server` HTTP endpoint can execute OS commands with the privileges of the server process. In containerized deployments with host mounts or internal network reachability, this can become filesystem compromise or network pivoting from the gateway host.\n\n## Suggested Fix\n\nRemove raw `getattr` and `setattr` from `safe_builtins`, expose only policy-controlled attribute access if dynamic lookup is required, replace substring filtering with a stricter RestrictedPython policy pipeline, and add authentication to HTTP transport for all `tools/call` requests.\n\n## Caveats\n\nThis report covers the `python_sandbox_server` sub-project. The core ContextForge gateway and proxy components are not directly affected. The Critical score assumes HTTP reachability; stdio-only deployments reduce the attack vector.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mcp-contextforge-gateway"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/IBM/mcp-context-forge/security/advisories/GHSA-xm98-3vcf-fph7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/IBM/mcp-context-forge/commit/63a2900e6301b9c8a483a38d3737a1beb3a7ce89"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/IBM/mcp-context-forge"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/IBM/mcp-context-forge/releases#release-v1.0.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-693", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-24T19:20:58Z",
    "nvd_published_at" : null
  }
}