Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2024-8251: CWE-89 Improper Neutralization of Special Elements used in an SQL Command in mintplex-labs mintplex-labs/anything-llm

0
Medium
VulnerabilityCVE-2024-8251cvecve-2024-8251cwe-89
Published: Thu Mar 20 2025 (03/20/2025, 10:08:48 UTC)
Source: CVE Database V5
Vendor/Project: mintplex-labs
Product: mintplex-labs/anything-llm

Description

A vulnerability in mintplex-labs/anything-llm prior to version 1.2.2 allows for Prisma injection. The issue exists in the API endpoint "/embed/:embedId/stream-chat" where user-provided JSON is directly taken to the Prisma library's where clause. An attacker can exploit this by providing a specially crafted JSON object, such as {"sessionId":{"not":"a"}}, causing Prisma to return all data from the table. This can lead to unauthorized access to all user queries in embedded chat mode.

AI-Powered Analysis

AILast updated: 10/15/2025, 13:20:37 UTC

Technical Analysis

CVE-2024-8251 is a Prisma injection vulnerability classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command) affecting the mintplex-labs/anything-llm product before version 1.2.2. The flaw resides in the API endpoint "/embed/:embedId/stream-chat", where user-provided JSON input is directly passed into the Prisma ORM's 'where' clause without adequate sanitization or validation. Prisma is a popular ORM for Node.js applications, and improper handling of its query parameters can lead to injection attacks similar to classic SQL injection. In this case, an attacker can submit a specially crafted JSON object, for example {"sessionId":{"not":"a"}}, which manipulates the query logic to bypass intended filters and retrieve all records from the underlying database table. This results in unauthorized disclosure of all user queries made in embedded chat mode, compromising confidentiality. The vulnerability is remotely exploitable without authentication or user interaction, increasing its risk profile. Although the CVSS score is 5.3 (medium), reflecting limited impact on integrity and availability, the confidentiality breach can be significant depending on the sensitivity of the data stored. No known exploits have been reported in the wild, and no official patches are currently linked, though upgrading to version 1.2.2 or later is recommended once available. The root cause is insufficient input validation and failure to properly neutralize special elements in the Prisma query construction, highlighting the need for secure coding practices when using ORMs. This vulnerability underscores the importance of sanitizing user inputs even in NoSQL or ORM contexts to prevent injection attacks.

Potential Impact

For European organizations using mintplex-labs/anything-llm, especially those embedding chat functionalities that handle sensitive user queries or data, this vulnerability poses a risk of unauthorized data exposure. Attackers exploiting this flaw can retrieve all user queries processed by the embedded chat, potentially leaking confidential business information, personally identifiable information (PII), or intellectual property. This could lead to reputational damage, regulatory non-compliance (e.g., GDPR violations), and loss of customer trust. Since the vulnerability does not affect data integrity or availability, the primary concern is confidentiality. However, the ease of remote exploitation without authentication increases the threat level. Organizations in sectors such as finance, healthcare, legal, and technology that rely on embedded AI chat solutions are particularly at risk. Additionally, the lack of known exploits in the wild suggests that proactive mitigation can effectively prevent compromise. Failure to address this vulnerability could also invite targeted attacks from threat actors interested in data harvesting or espionage, especially given the growing use of AI-driven chat applications in Europe.

Mitigation Recommendations

1. Upgrade to mintplex-labs/anything-llm version 1.2.2 or later as soon as an official patch is released that addresses this Prisma injection vulnerability. 2. Until a patch is available, implement strict input validation and sanitization on all JSON inputs accepted by the "/embed/:embedId/stream-chat" API endpoint to reject or neutralize special query operators such as 'not', 'or', 'and', and others that can manipulate Prisma queries. 3. Employ parameterized queries or ORM features that safely handle user inputs without directly injecting them into query clauses. 4. Introduce application-layer access controls to restrict API usage to authenticated and authorized users, reducing the attack surface. 5. Monitor API logs for unusual query patterns or large data retrievals that may indicate exploitation attempts. 6. Conduct code reviews and security testing focusing on injection flaws in all endpoints that accept user-controlled JSON for database queries. 7. Educate developers on secure ORM usage and the risks of improper query construction. 8. Consider implementing Web Application Firewalls (WAF) with custom rules to detect and block suspicious JSON payloads targeting the vulnerable endpoint. 9. Regularly audit and update dependencies to incorporate security fixes promptly.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
@huntr_ai
Date Reserved
2024-08-27T23:38:48.098Z
Cvss Version
3.0
State
PUBLISHED

Threat ID: 68ef9b2d178f764e1f470e50

Added to database: 10/15/2025, 1:01:33 PM

Last enriched: 10/15/2025, 1:20:37 PM

Last updated: 10/16/2025, 2:20:21 PM

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats