What happened
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).
Why it matters
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.
Attack vector
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.
Affected systems
mcp-use ≤ 1.7.1 (libraries/python/mcp_use/client/code_executor.py)
Mitigation
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.