Vulnerability  ·  2026-12-02

mcp-use CodeExecutor _build_namespace code injection — no upstream fix; built-in Python sandbox not for production

VulnerabilityMedium impactGlobalCVE-2026-140133
CVE-2026-140133 is a code-injection flaw in mcp-use's CodeExecutor (code_executor.py _build_namespace) affecting versions up to 1.7.1. The project maintainer notes the built-in Python sandbox executor is not meant for production use, and no fix has been released as of the record date. CVSS ~6.9 (CNA) / 5.5 (NVD).
mcp-use is a popular MCP integration library; an agent executing code through its built-in Python sandbox can be pushed into code injection if the sandbox is trusted for untrusted instructions. Blast radius is limited because the sandbox is explicitly 'not for production' and no exploit is reported.
The _build_namespace function in the CodeExecutor processes code fed by an MCP client, and manipulable arguments lead to code injection (CWE-74/CWE-94). No fix is published yet.
mcp-use ≤ 1.7.1 (libraries/python/mcp_use/client/code_executor.py)
No upstream fix published; treat the built-in sandbox as untrusted. Migrate to an external sandbox provider (e.g. a container/VM) for any untrusted agent code execution and do not expose the sandbox to untrusted MCP clients.
GitHub issue — mcp-use #2816NVD — CVE-2026-140133
See this in the live feed Explore related AI security and governance findings — updated every morning.
Open the feed →