CVE-2026-140133: mcp-use CodeExecutor code_executor.py _build_namespace code injection

Published Dec 1, 2026
·
Updated

A vulnerability was determined in mcp-use up to 1.7.1. Affected by this vulnerability is the function buildnamespace of the file libraries/python/mcpuse/client/codeexecutor.py of the component CodeExecutor. Executing a manipulation of the argument code can lead to code injection. The attack can be launched remotely. The project maintainer explains, that the built-in Python sandbox executor is not meant for production use and users should rely on external sandbox providers.

Affected Software

1 affected component
pypi/mcp-use<=1.7.1

Event History

Dec 1, 2026
CVE Published
via MITRE·07:30 AM
Data Sourced
via MITRE·07:30 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Deployments of mcp-use up to version 1.7.1 that use the built-in Python sandbox executor and pass attacker-influenced content to the CodeExecutor code argument are exposed. The attack can be launched remotely and does not require stated privileges or user interaction.

2

What does an attacker need to exploit it?

An attacker needs the ability to manipulate the code argument processed by CodeExecutor's _build_namespace function. The supplied data indicates low attack complexity and no required privileges or user interaction.

3

Are default deployments affected?

The available information identifies the built-in Python sandbox executor as the affected context, but does not state whether it is enabled or used by default. Environments relying on an external sandbox provider are not identified as affected by the description.

4

What can be done if patching is not immediately possible?

Do not rely on the built-in Python sandbox executor in production. Use an external sandbox provider and prevent untrusted parties from influencing the code argument supplied to CodeExecutor.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203