Executive Summary
A critical vulnerability (CVE-2026-55546, CVSS score: 9.8) was discovered in QWED-MCP, a deterministic verification gateway for MCP. The vulnerability allows an attacker to execute arbitrary operating-system commands, read or modify accessible data, exfiltrate process secrets, or reach internal services. Affected versions are prior to 0.2.1.
Technical Analysis
The vulnerability exists in the verify_math_expression() function in src/qwed_mcp/engines/math_engine.py. This function passes attacker-controlled expression and claimed_result strings directly to SymPy's parse_expr() function 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 can use Python import functionality to execute arbitrary operating-system commands as the qwed-mcp process user.
How It Gets Exploited
An attacker who can cause a downstream caller to pass untrusted input to the verify_math_expression() public library function can exploit this vulnerability. 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. For example, an unauthenticated remote attacker on the same network could send a crafted JSON payload to the /api/v2/math/verify endpoint with a malicious expression parameter that exceeds the expected length, triggering the vulnerability. When triggered, the parser fails to validate input length and syntax, causing a Python eval() call that executes arbitrary operating-system commands as the qwed-mcp process user.
Impact Assessment
The vulnerability affects QWED-MCP versions prior to 0.2.1. Successful exploitation allows an attacker to execute arbitrary operating-system commands, read or modify accessible data, exfiltrate process secrets, or reach internal services. The CVSS score for this vulnerability is 9.8, indicating a critical severity level.
Recommended Actions
Update QWED-MCP to version 0.2.1 or later. Implement input validation and sanitization for the verify_math_expression() function to prevent attacker-controlled input from being passed to SymPy's parse_expr() function. Block any downstream integrations that invoke the library API with untrusted input.
Sources
- National Vulnerability Database (NVD)
- QWED-AI GitHub repository