CVE-2026-140133
mcp-use restricted Python builtins do not contain code-mode execution
mcp-use · mcp-use
First documented disclosure · Review checkpoint
Summary
In-process Python execution can reach powerful objects despite a reduced builtins namespace.
Severity and exploitation evidence
Medium · 6.9/10 · CVSS 4.0. Severity source.
Exploitation not established: The researcher supplies a controlled object-graph example and says further PoC details are available on request. No malicious exploitation or victims are established; no example was executed.
Technical severity is not a measure of observed attacks or of risk to your deployment. Attempts, demonstrations, and successful compromise retain the qualifications in the source.
How the weakness works
CodeExecutor._build_namespace restricts named builtins while ordinary Python attribute access still reaches the live object graph. Code-mode tooling can therefore escape the intended restriction.
Conditions required
An application runs the built-in executor on untrusted code, or an agent with code_mode=True produces attacker-influenced code. There must be access to that execution path; this is not evidence that every mcp-use deployment is remotely exposed.
Potential impact
Execution with the MCP client process’s available file, network and credential privileges.
Affected versions and configurations
CNA identifies 1.7.0 and 1.7.1; the original report describes 1.7.0 and a September 4 main revision.
Fix and mitigation status
No fixed package or accepted containment patch verified. The maintainer closed the issue while stating that the built-in Python and TypeScript executors are not intended for production and recommending external sandbox providers.
Practical next steps
Use an external execution sandbox for untrusted code and do not treat an in-process Python object/builtins blocklist as isolation.
Operating lesson
Language-level name restrictions do not create an operating-system security boundary.
Evidence and limits
The public issue opened October 9. Its claimed September 4 GHSA report is not verified public disclosure; that GHSA returned404. The researcher proposes AST checks but acknowledges that these are not proof of containment. Maintainer deployment guidance is preserved alongside the CNA classification. Issuing CNA publication was 2026-12-01, distinct from the earliest verified public disclosure used here. Severity is VulDB CNA CVSS 4.0 Medium 6.9. Static review only; upstream tests were not repeated.
Sources
- Original public report and maintainer scope statement
Primary source ·
- Issuing CNA record
Primary source ·