<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>QWED-AI - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/qwed-ai/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 25 Aug 2026 16:01:38 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/qwed-ai/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>Remote Code Execution in qwed-mcp via Unsafe SymPy Input</title><link>https://feed.craftedsignal.io/briefs/2026-08-qwed-mcp-rce/</link><pubDate>Tue, 25 Aug 2026 16:01:38 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-qwed-mcp-rce/</guid><description>The qwed-mcp library v0.2.0 is vulnerable to arbitrary remote code execution because it passes unsanitized input to SymPy's parse_expr function, allowing attackers to execute arbitrary system commands via Python code injection.</description><content:encoded><![CDATA[<p>The qwed-mcp library, specifically version 0.2.0, contains a critical security vulnerability in the <code>verify_math_expression</code> function located in <code>src/qwed_mcp/engines/math_engine.py</code>. The function accepts raw string input for mathematical expressions and forwards them to <code>sympy.parsing.sympy_parser.parse_expr()</code> without proper sanitization or namespace restriction.</p>
<p>Internally, SymPy's <code>parse_expr()</code> utilizes the Python <code>eval()</code> function. Because the library fails to restrict the global namespace or define an empty <code>__builtins__</code> dictionary, the evaluation process inherits the current module's full built-in scope. This allows an attacker to inject and execute arbitrary Python expressions, including <code>__import__('os').system()</code>. This vulnerability facilitates full remote code execution in the context of the running process with the privileges of the executing user, as confirmed by successful exploitation experiments in a standard Python Docker container.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a service or application utilizing <code>qwed-mcp</code> that allows submission of arbitrary mathematical expressions to the <code>verify_math_expression</code> function.</li>
<li>The attacker crafts a malicious Python payload (e.g., <code>__import__('os').system('command')</code>) designed to escape the expected mathematical evaluation context.</li>
<li>The target application receives the payload and passes it as the <code>expression</code> or <code>claimed_result</code> argument to <code>qwed_mcp.engines.math_engine.verify_math_expression</code>.</li>
<li><code>verify_math_expression</code> performs basic string replacement (<code>^</code> to <code>**</code>) and forwards the unsanitized string to <code>sympy.parsing.sympy_parser.parse_expr</code>.</li>
<li><code>parse_expr</code> invokes Python's <code>eval()</code> function using the unrestricted module namespace, which includes access to <code>os</code> and other powerful modules via <code>__builtins__</code>.</li>
<li>The <code>os.system()</code> payload executes the specified OS commands with the permissions of the application process.</li>
<li>The attacker achieves persistent access or exfiltration by redirecting output to temporary files or establishing outbound C2 communication.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows an attacker to achieve full remote code execution on the host machine or container running the <code>qwed-mcp</code> library. This grants the attacker the ability to read, modify, or delete files, exfiltrate sensitive environment variables and credentials, and pivot into the internal network. Because the vulnerability is directly accessible via the library's API, any application integrating <code>qwed-mcp</code> that exposes this function to external input is at immediate risk of total system compromise.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Immediately upgrade to a patched version of <code>qwed-mcp</code> if available, or apply the remediation patch provided in the advisory to <code>math_engine.py</code>.</li>
<li>Update <code>math_engine.py</code> to implement strict AST pre-validation using the <code>ast</code> module to ensure only safe mathematical constructs are processed.</li>
<li>Explicitly set <code>global_dict={&quot;__builtins__&quot;: {}}</code> in all calls to <code>parse_expr()</code> to eliminate the possibility of accessing sensitive built-in functions during evaluation.</li>
<li>Audit applications utilizing <code>qwed-mcp</code> to ensure no user-controlled input reaches the <code>verify_math_expression</code> function without secondary validation.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>remote-code-execution</category><category>python</category><category>injection</category><category>supply-chain</category></item></channel></rss>