PT-2026-81397 · Pypi · Qwed
CVSS v3.1
8.8
High
| Vector | AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Name of the Vulnerable Software and Affected Versions
QWED versions prior to 5.1.2
Description
Authenticated users can execute arbitrary Python code within the API server process because the
qwed package passes user-controlled math expressions to the SymPy parse expr() function without restricting the global dict and local dict namespaces. Since parse expr() internally utilizes Python's eval(), this allows for full system compromise, including reading or writing files, executing operating system commands, and accessing data from other tenants in shared deployments.Technical details include two vulnerable paths:
- The
POST /verify/mathendpoint reads theexpressionvariable and passes it toparse expr()after a cosmetic normalization. - The
POST /verify/batchendpoint processes items where thequeryvariable is passed toparse expr()when the type is set toVerificationType.MATH.
Attackers can obtain the necessary authentication by using the default-enabled
POST /auth/signup endpoint to create a tenant account and the POST /auth/api-keys endpoint to generate an API key.Recommendations
Update QWED to version 5.1.2.
As a temporary mitigation, restrict access to the
POST /verify/math and POST /verify/batch endpoints or disable the POST /auth/signup endpoint to prevent unauthorized account creation.Exploit
Fix
Code Injection
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Qwed