CVE-2026-55546

QWED-MCP: Unsafe SymPy `parse_expr()` Remote Code Execution via Unsanitized Math Expression Input

Published Aug 25, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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
Type Values Removed Values Added
First Time appeared Qwed-ai
Qwed-ai qwed-mcp
Vendors & Products Qwed-ai
Qwed-ai qwed-mcp
Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses
  • CWE-94

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 25, 2026, 6:26 PM
Reserved
Jun 16, 2026, 11:01 PM
Status
Deferred
Published
Aug 25, 2026, 4:16 PM
Modified
Sep 9, 2026, 9:07 PM