<?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 (5.1.1) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/qwed-5.1.1/</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 18:50:28 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/qwed-5.1.1/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>Authenticated Remote Code Execution in qwed via Unsafe SymPy Parsing</title><link>https://feed.craftedsignal.io/briefs/2026-08-qwed-rce/</link><pubDate>Tue, 25 Aug 2026 18:50:28 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-qwed-rce/</guid><description>The qwed package (version 5.1.1) fails to sanitize input in math verification endpoints, allowing authenticated attackers to achieve remote code execution via unsafe SymPy expression evaluation.</description><content:encoded><![CDATA[<p>The qwed package, specifically version 5.1.1, contains an authenticated remote code execution (RCE) vulnerability stemming from the unsafe use of <code>sympy.parsing.sympy_parser.parse_expr()</code>. The application exposes two primary endpoints, <code>POST /verify/math</code> and <code>POST /verify/batch</code>, which accept user-supplied mathematical expressions. These inputs are passed directly to <code>parse_expr()</code> without configuring a restricted namespace for the underlying <code>eval()</code> call. Any user, including those creating new accounts via the default-enabled <code>/auth/signup</code> endpoint, can supply arbitrary Python code within these expressions. This allows for full server-side command execution under the context of the running application process. The lack of sandbox parameters (<code>global_dict</code> and <code>local_dict</code>) in the SymPy calls effectively disables Python's built-in security boundaries, enabling attackers to read files, modify the local database, or execute OS-level commands.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker interacts with the <code>POST /auth/signup</code> endpoint to create a standard, unprivileged tenant account.</li>
<li>Attacker uses the returned JWT to authenticate requests to the <code>POST /auth/api-keys</code> endpoint to generate a persistent API key.</li>
<li>Attacker identifies the <code>POST /verify/math</code> or <code>POST /verify/batch</code> endpoints as injection sinks for user-supplied math queries.</li>
<li>Attacker constructs a malicious Python expression payload using <code>pathlib</code> or <code>os</code> modules to interact with the host filesystem.</li>
<li>Attacker submits the payload within the JSON <code>expression</code> field (for <code>/verify/math</code>) or <code>query</code> field (for <code>/verify/batch</code>) using the previously generated API key.</li>
<li>The server application receives the request and passes the unvalidated input string directly to the vulnerable <code>parse_expr()</code> function.</li>
<li>The SymPy library evaluates the injected Python code string via <code>eval()</code> within the process memory space.</li>
<li>Final objective reached: arbitrary command execution, leading to complete server compromise or data exfiltration.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation results in full remote code execution, granting the attacker the same permissions as the system user running the qwed API server. This permits unauthorized read/write access to the host filesystem, exfiltration of environment variables containing sensitive secrets (e.g., <code>QWED_JWT_SECRET_KEY</code>), modification of persistent data, and potential lateral movement within the container or host environment.</p>
<h2 id="recommendation">Recommendation</h2>
<p>Prioritize patching the qwed package to a version that sanitizes all input passed to SymPy's <code>parse_expr()</code> function. If upgrading is not immediately possible, implement strict input validation to ensure math expressions only contain alphanumeric characters and expected mathematical operators, preventing the injection of Python syntax. Additionally, utilize the provided Sigma detection rule to monitor for suspicious POST requests to verification endpoints containing Python built-ins or module import syntax.</p>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>remote-code-execution</category><category>input-validation</category><category>python</category></item></channel></rss>