CWE-943: Improper Neutralization of Special Elements in Data Query Logic
Also known as: NoSQL Injection, NoSQLi
The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.
Last updated
Overview
Depending on the capabilities of the query language, an attacker could inject additional logic into the query to: Modify the intended selection criteria, thus changing which data entities (e.g., records) are returned, modified, or otherwise manipulated Append additional commands to the query Return more entities than intended Return fewer entities than intended Cause entities to be sorted in an unexpected way The ability to execute additional commands or change which entities are returned has obvious risks. But when the product logic depends on the order or number of entities, this can also lead to vulnerabilities. For example, if the query expects to return only one entity that specifies an administrative user, but an attacker can change which entities are returned, this could cause the logic to return information for a regular user and incorrectly assume that the user has administrative privileges. While this weakness is most commonly associated with SQL injection, there are many other query languages that are also subject to injection attacks, including HTSQL, LDAP, DQL, XQuery, Xpath, and "NoSQL" languages.
Real-world CVEs
133 recorded CVEs are caused by CWE-943 (Improper Neutralization of Special Elements in Data Query Logic). The highest-severity and most recent are shown first. 118 new CWE-943 CVEs have been recorded so far in 2026 (5 in 2025).
- CVE-2024-4872Critical · CVSS 9.9 · EPSS 43th2024-08-27
- CVE-2026-8649
Institution scope bypass vulnerability in custom reports
Critical · CVSS 9.8 · EPSS 40th2026-07-08 - CVE-2026-40351
FastGPT: NoSQL Injection in loginByPassword leads to Authentication Bypass
Critical · CVSS 9.8 · EPSS 50th2026-04-17 - CVE-2026-120201
Jpom 2.10.0 through 2.11.12 Authentication Bypass via JPOM-USER-TOKEN Header
Critical · CVSS 9.3 · EPSS 83th2026-10-31 - CVE-2026-41274
Flowise: Cypher Injection in GraphCypherQAChain
Critical · CVSS 9.3 · EPSS 43th2026-04-23 - CVE-2026-32248
Parse Server: Account takeover via operator injection in authentication data identifier
Critical · CVSS 9.3 · EPSS 53th2026-03-12 - CVE-2026-29793
NoSQL Injection via WebSocket id Parameter in MongoDB Adapter
Critical · CVSS 9.3 · EPSS 44th2026-03-10 - CVE-2026-20284
Cisco Identity Search Engine SXP REST API SQL Injection Vulnerability
Critical · CVSS 9.1 · EPSS 45th2026-09-16 - CVE-2026-45689
Rocket.Chat: Pre-Auth NoSQL Injection in OAuth2 Token Endpoint leading to Arbitrary User ATO
Critical · CVSS 9.1 · EPSS 45th2026-06-24 - CVE-2026-45688
Rocket.Chat: Pre-Auth NoSQL Injection in CAS Login Handler leading to Arbitrary CAS/SAML User Session Hijack
Critical · CVSS 9.1 · EPSS 43th2026-06-24 - CVE-2026-41327
Dgraph: Pre-Auth Full Database Exfiltration via DQL Injection in Upsert Condition Field
Critical · CVSS 9.1 · EPSS 42th2026-04-24 - CVE-2026-41328
Dgraph: Pre-Auth Full Database Exfiltration via DQL Injection in NQuad Lang Field
Critical · CVSS 9.1 · EPSS 36th2026-04-24
Showing 12 of 133 recorded CWE-943 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsCommon consequences
What can happen when CWE-943 is exploited.
Bypass Protection Mechanism, Read Application Data, Modify Application Data, Varies by Context
Affects: Confidentiality, Integrity, Availability, Access Control
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
Code examples
MITRE examples of the weakness in code.
The following code dynamically constructs and executes a SQL query that searches for items matching a specified name. The query restricts the items displayed to those where owner matches the user name of the currently-authenticated user.
Example
SELECT * FROM items WHERE owner = <userName> AND itemname = <itemName>;Attack input
name' OR 'a'='aAttack input
SELECT * FROM items WHERE owner = 'wiley' AND itemname = 'name' OR 'a'='a';Attack input
OR 'a'='aAttack input
SELECT * FROM items;The code below constructs an LDAP query using user input address data:
Because the code fails to neutralize the address string used to construct the query, an attacker can supply an address that includes additional LDAP queries.
Consider the following simple XML document that stores authentication information and a snippet of Java code that uses XPath query to retrieve authentication information:
Example
<users>
<user>
<login>john</login>
<login>cbc</login>Attack input
//users/user[login/text()='john' or ''='' and password/text() = '' or ''='']/home_dir/text()Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2024-50672 — NoSQL injection in product for building eLearning courses allows password resets using a query processed by the Mongoose find function
- CVE-2021-20736 — NoSQL injection in team collaboration product
- CVE-2020-35666 — NoSQL injection in a PaaS platform using a MongoDB operator
- CVE-2014-2503 — Injection using Documentum Query Language (DQL)
- CVE-2014-2508 — Injection using Documentum Query Language (DQL)
Terminology & mappings
Alternate terms
- NoSQL Injection, NoSQLi
- Injection of data query language into NoSQL databases such as Cassandra, ElasticSearch, MongoDB, Redis, and others
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-943.
- What is CWE-943?
- The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.
- What CVEs are caused by CWE-943?
- 133 recorded CVEs are attributed to CWE-943, including CVE-2024-4872, CVE-2026-8649 and CVE-2026-40351.
- How is CWE-943 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-943?
- Exploiting CWE-943 can lead to: Bypass Protection Mechanism, Read Application Data, Modify Application Data, Varies by Context.
- Is CWE-943 actively exploited?
- 133 recorded CVEs are caused by CWE-943; none are currently in CISA's KEV catalog of actively exploited flaws.
Sources
References
- MITRE CWE definition (CWE-943) (opens in a new tab)
- CWE-943 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-943 CVEs
Get an alert when a new CWE-943 CVE affects your products, with AI-written analysis and remediation steps.