{"id":"CVE-2026-53710","aliases":["EUVD-2026-78933","GHSA-xm98-3vcf-fph7","PYSEC-2026-3862"],"status":"published","title":"MCP Context Forge: RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server","description":"MCP Context Forge is an AI gateway, registry, and proxy for MCP, A2A, REST, and gRPC APIs. Prior to 1.0.2, the python_sandbox_server in mcp-servers/python/python_sandbox_server/src/python_sandbox_server/server_fastmcp.py exposes raw getattr through safe_builtins, omits a required _getattr_ guard, and relies on validate_code checks for literal dangerous dunder strings. An attacker can construct dunder names at runtime, traverse the Python class hierarchy, reach subprocess.Popen, and execute OS commands with the server process privileges through the execute_code MCP tool. The HTTP/SSE transport can expose this tool without authentication, while stdio-only deployments have reduced network reachability. The issue affects the python_sandbox_server subproject and does not directly affect the core Context Forge gateway or proxy components. This issue is fixed in version 1.0.2.","severity":{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01141,"percentile":0.67078,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-693","CWE-94"],"published":"2026-08-24T19:20:58Z","modified":"2026-11-04T02:48:04Z","fixes":[{"ecosystem":"PyPI","package":"mcp-contextforge-gateway","fixed_in":["1.0.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"mcp-contextforge-gateway","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.0.1"},{"fixed":"1.0.2"}]}]},{"source":"osv","ecosystem":"PyPI","package":"mcp-contextforge-gateway","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.2"}]}],"versions":["0.1.0","0.1.1","0.2.0","0.3.0","0.3.1","0.4.0","0.5.0","0.6.0","0.7.0","0.8.0","0.9.0","1.0.0","1.0.0b1","1.0.0b2","1.0.0rc1","1.0.1"]},{"source":"osv","ecosystem":"PyPI","package":"mcp-contextforge-gateway","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.2"}]}],"versions":["0.1.0","0.1.1","0.2.0","0.3.0","0.3.1","0.4.0","0.5.0","0.6.0","0.7.0","0.8.0","0.9.0","1.0.0","1.0.0b1","1.0.0b2","1.0.0rc1","1.0.1"]}],"products":[{"vendor":"ibm","product":"mcp-context-forge"}],"references":[{"url":"https://github.com/IBM/mcp-context-forge/security/advisories/GHSA-xm98-3vcf-fph7","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/IBM/mcp-context-forge/commit/63a2900e6301b9c8a483a38d3737a1beb3a7ce89","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/IBM/mcp-context-forge/releases/tag/v1.0.2","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/IBM/mcp-context-forge/releases#release-v1.0.2","tags":["web"]},{"url":"https://github.com/advisories/GHSA-xm98-3vcf-fph7","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53710.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53710","tags":["advisory"]},{"url":"https://github.com/IBM/mcp-context-forge","tags":["package"]},{"url":"https://pypi.org/project/mcp-contextforge-gateway","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-53710","title":"MCP Context Forge: RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server","description":"MCP Context Forge is an AI gateway, registry, and proxy for MCP, A2A, REST, and gRPC APIs. Prior to 1.0.2, the python_sandbox_server in mcp-servers/python/python_sandbox_server/src/python_sandbox_server/server_fastmcp.py exposes raw getattr through safe_builtins, omits a required _getattr_ guard, and relies on validate_code checks for literal dangerous dunder strings. An attacker can construct dunder names at runtime, traverse the Python class hierarchy, reach subprocess.Popen, and execute OS commands with the server process privileges through the execute_code MCP tool. The HTTP/SSE transport can expose this tool without authentication, while stdio-only deployments have reduced network reachability. The issue affects the python_sandbox_server subproject and does not directly affect the core Context Forge gateway or proxy components. This issue is fixed in version 1.0.2.","status":"published","published":"2026-09-15T16:47:41.085Z","modified":"2026-09-15T19:45:23.818Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-94","CWE-693"],"updated_at":"2026-11-02T14:20:00.11477Z"}],"euvd":[{"id":"EUVD-2026-78933","description":"MCP Context Forge is an AI gateway, registry, and proxy for MCP, A2A, REST, and gRPC APIs. Prior to 1.0.2, the python_sandbox_server in mcp-servers/python/python_sandbox_server/src/python_sandbox_server/server_fastmcp.py exposes raw getattr through safe_builtins, omits a required _getattr_ guard, and relies on validate_code checks for literal dangerous dunder strings. An attacker can construct dunder names at runtime, traverse the Python class hierarchy, reach subprocess.Popen, and execute OS commands with the server process privileges through the execute_code MCP tool. The HTTP/SSE transport can expose this tool without authentication, while stdio-only deployments have reduced network reachability. The issue affects the python_sandbox_server subproject and does not directly affect the core Context Forge gateway or proxy components. This issue is fixed in version 1.0.2.","status":"published","published":"2026-09-15T16:47:41Z","modified":"2026-09-15T19:45:23Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T17:28:16.983725Z"}],"ghsa":[{"id":"GHSA-xm98-3vcf-fph7","title":"mcp-contextforge-gateway has RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server","description":"**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.","status":"published","published":"2026-08-24T19:20:58Z","modified":"2026-10-15T01:07:05Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-94","CWE-693"],"updated_at":"2026-11-02T14:41:31.175024Z"}],"nvd":[{"id":"CVE-2026-53710","description":"MCP Context Forge is an AI gateway, registry, and proxy for MCP, A2A, REST, and gRPC APIs. Prior to 1.0.2, the python_sandbox_server in mcp-servers/python/python_sandbox_server/src/python_sandbox_server/server_fastmcp.py exposes raw getattr through safe_builtins, omits a required _getattr_ guard, and relies on validate_code checks for literal dangerous dunder strings. An attacker can construct dunder names at runtime, traverse the Python class hierarchy, reach subprocess.Popen, and execute OS commands with the server process privileges through the execute_code MCP tool. The HTTP/SSE transport can expose this tool without authentication, while stdio-only deployments have reduced network reachability. The issue affects the python_sandbox_server subproject and does not directly affect the core Context Forge gateway or proxy components. This issue is fixed in version 1.0.2.","status":"published","published":"2026-09-15T17:17:19.117Z","modified":"2026-09-30T17:51:56.193Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"secondary"}],"cwes":["CWE-94","CWE-693"],"updated_at":"2026-11-02T14:12:47.668237Z"}],"osv":[{"id":"CVE-2026-53710","title":"MCP Context Forge: RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server","description":"MCP Context Forge is an AI gateway, registry, and proxy for MCP, A2A, REST, and gRPC APIs. Prior to 1.0.2, the python_sandbox_server in mcp-servers/python/python_sandbox_server/src/python_sandbox_server/server_fastmcp.py exposes raw getattr through safe_builtins, omits a required _getattr_ guard, and relies on validate_code checks for literal dangerous dunder strings. An attacker can construct dunder names at runtime, traverse the Python class hierarchy, reach subprocess.Popen, and execute OS commands with the server process privileges through the execute_code MCP tool. The HTTP/SSE transport can expose this tool without authentication, while stdio-only deployments have reduced network reachability. The issue affects the python_sandbox_server subproject and does not directly affect the core Context Forge gateway or proxy components. This issue is fixed in version 1.0.2.","status":"published","published":"2026-09-15T16:47:41.085Z","modified":"2026-11-06T10:46:27.674624136Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-693","CWE-94"],"updated_at":"2026-11-06T11:08:57.800854Z"},{"id":"GHSA-xm98-3vcf-fph7","title":"mcp-contextforge-gateway has RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server","description":"**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.","status":"published","published":"2026-08-24T19:20:58Z","modified":"2026-09-10T12:25:44.827501965Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-693","CWE-94"],"updated_at":"2026-11-02T15:47:00.198893Z"},{"id":"PYSEC-2026-3862","title":"mcp-contextforge-gateway has RestrictedPython sandbox bypass via getattr builtin in python_sandbox_server","description":"**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.","status":"published","published":"2026-09-10T09:44:53.257579Z","modified":"2026-09-10T12:15:11.009024125Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:52:57.255153Z"}]}}
