pypi package report

Is mcp-contextforge-gateway safe?

3 known vulnerabilities, worst severity CRITICAL.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      No published models are known to use this package.


      cvss
      10.0
      critical

      CVSS v3.1 base score out of 10

      epss
      1.1%
      medium

      chance of exploitation in 30 days, 67th percentile of all CVEs

      xyz score
      4.0
      medium

      CyberXYZ composite out of 10

      fig. 01 — GHSA-xm98-3vcf-fph7, the advisory selected below

      // 3 advisories

      GHSA-xm98-3vcf-fph7

      CRITICALGitHub ratingCVE-2026-53710

      Commit: f855e54d5b7b 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:

      • Raw getattr is exposed in safe_builtins, bypassing _getattr_ mediation.
      • validate_code checks for literal dangerous dunder strings, but the payload constructs those names at runtime.
      • 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:

      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:

      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.

      // cvss v3.1 vector

      CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

      Attack vector
      Network
      Attack complexity
      Low
      Privileges required
      None
      User interaction
      None
      Scope
      Changed
      Confidentiality
      High
      Integrity
      High
      Availability
      High

      Checked 2026-11-07 at 13:17 UTC. The most recent advisory here was published 2026-08-25. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.