Description
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.
Published: 2026-08-25
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution via unsanitized SymPy expression parsing
Action: Patch Immediately
AI Analysis

Impact

QWED-MCP, a deterministic verification gateway, includes a function that forwards attacker-controlled math expressions directly to SymPy’s parse_expr without restricting Python built‑ins or validating the expression’s abstract syntax tree. Because parse_expr internally uses eval with built‑ins available, an adversary can craft an expression containing Python import statements to execute arbitrary operating‑system commands, read or modify data accessible to the qwed-mcp process, exfiltrate secrets, or reach internal services. The vulnerability is therefore a high‑impact remote code execution flaw.

Affected Systems

Vulnerable builds of QWED‑MCP, specifically any release before v0.2.1, on any environment that exposes verify_math_expression to external input. The product is distributed by QWED‑AI as"QWED‑MCP". The default MCP tool registry does not expose the vulnerable function, so penetration requires a downstream integration that calls the library through the verify_math_expression API.

Risk and Exploitability

The CVSS score of 9.8 marks this issue as critical. The EPSS score is not available, and it is not yet listed in CISA’s KEV catalog, implying the market exploitation risk is currently undefined but the technical severity remains high. Exploitation requires that a caller can supply untrusted input to the public API; thus an attacker can trigger the vulnerability through any integration that invokes verify_math_expression with attacker-controlled data. Given the absence of additional mitigating controls, the likelihood of successful exploitation is significant in environments where untrusted inputs reach this function.

Generated by OpenCVE AI on August 25, 2026 at 16:35 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade QWED‑MCP to version 0.2.1 or newer, where parse_expr is invoked with a restricted global_dict and no built‑ins are exposed.
  • Ensure that any downstream integrations validate or sanitize all math expression input before passing it to QWED‑MCP’s verify_math_expression API.
  • Configure the application to run QWED‑MCP under the principle of least privilege, limiting its filesystem, network, and process capabilities to mitigate any potential compromise if exploitation occurs.

Generated by OpenCVE AI on August 25, 2026 at 16:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-mw6r-2hvm-4rp2 qwed-mcp has Unsafe SymPy `parse_expr()` Remote Code Execution via Unsanitized Math Expression Input
History

Fri, 28 Aug 2026 21:00:00 +0000

Type Values Removed Values Added
First Time appeared Qwed-ai
Qwed-ai qwed-mcp
Vendors & Products Qwed-ai
Qwed-ai qwed-mcp

Tue, 25 Aug 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 25 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Description 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.
Title QWED-MCP: Unsafe SymPy `parse_expr()` Remote Code Execution via Unsanitized Math Expression Input
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

Qwed-ai Qwed-mcp
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-25T18:26:44.049Z

Reserved: 2026-06-16T23:01:04.075Z

Link: CVE-2026-55546

cve-icon Vulnrichment

Updated: 2026-08-25T18:26:15.880Z

cve-icon NVD

Status : Deferred

Published: 2026-08-25T16:16:55.160

Modified: 2026-09-09T21:07:31.353

Link: CVE-2026-55546

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-28T20:36:59Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')