Skip to main content

NoSQL Injection

web HIGH

NoSQL injection exploits databases that don't use traditional SQL syntax-like MongoDB, CouchDB, or Redis-by manipulating queries through unsanitized user input.

How It Works

NoSQL injection exploits databases that don't use traditional SQL syntax—like MongoDB, CouchDB, or Redis—by manipulating queries through unsanitized user input. Unlike SQL injection, attackers target JSON objects, operator syntax, and language-specific features. In MongoDB, for instance, an attacker might inject operator objects like {"$ne": null} into a login form where the application expects a simple string. If the backend constructs queries by directly merging user input into query objects, the injected operator transforms the query logic entirely.

Two primary attack vectors exist: operator injection and syntax injection. Operator injection abuses NoSQL-specific operators—$where, $ne, $gt, $regex—to alter query behavior. An authentication check expecting {username: "admin", password: "secret"} becomes {username: {"$ne": null}, password: {"$ne": null}}, matching any existing user. Syntax injection breaks out of the intended query structure, often by closing delimiters or injecting raw JavaScript when databases allow it (like MongoDB's $where clause).

Attackers typically probe by submitting JSON objects instead of strings, testing how the application processes structured input. They escalate by chaining operators to extract data character-by-character using regex patterns, or execute arbitrary JavaScript through $where clauses if the database allows server-side code evaluation.

Impact

  • Authentication bypass: Force login logic to return true by injecting operators that always match
  • Unauthorized data access: Extract entire collections by manipulating query conditions to return all records
  • Blind data exfiltration: Use regex operators to extract sensitive data one character at a time through timing or response differences
  • Denial of service: Trigger resource-intensive operations with malicious $where clauses or regex patterns
  • Remote code execution: Execute arbitrary JavaScript on database servers that evaluate $where expressions

Real-World Examples

A vulnerability in Parse Server (CVE-2019-5418) allowed attackers to bypass authentication by injecting MongoDB query operators through the password reset mechanism. By submitting an object with comparison operators instead of a password string, attackers could reset arbitrary user accounts without knowing credentials.

Several REST API frameworks demonstrated NoSQL injection when deserializing JSON without validation. Attackers sent requests with payloads like {"username": {"$gt": ""}} to administrative endpoints, causing the application to return all users instead of checking specific credentials. This pattern affected multiple Node.js applications using Mongoose without proper schema validation.

E-commerce platforms running MongoDB experienced data breaches where attackers used $regex injection to enumerate customer records. By systematically testing partial matches through URL parameters converted to query operators, they extracted email addresses and order histories without triggering traditional SQL injection defenses.

Mitigation

  • Use ODM/schema validation: Employ frameworks like Mongoose with strict schemas that reject unexpected operators
  • Type-check all inputs: Ensure user-supplied values match expected primitive types before query construction
  • Whitelist allowed fields: Only permit known-safe JSON keys in query objects, reject any operator syntax
  • Disable JavaScript execution: Turn off $where and similar features that evaluate code on the database server
  • Apply least privilege: Use database accounts with minimal permissions, restricting access to sensitive collections
  • Sanitize operators: Strip or escape characters like $ and . from user input before processing

Recent CVEs (101)

EPSS 0% CVSS 6.5
MEDIUM This Month

SAP NetWeaver Enterprise Portal allows an unauthenticated attacker to inject JNDI environment properties or pass a URL used during JNDI lookup operations, enabling access to an unintended JNDI. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

SAP Code Injection Nosql Injection
NVD
EPSS 0% CVSS 5.5
MEDIUM This Month

IBM Db2 12.1.0 through 12.1.2 for Linux, UNIX and Windows (includes Db2 Connect Server) could allow a local user to cause a denial of service due to improper neutralization of special elements in. Rated medium severity (CVSS 6.2), this vulnerability is no authentication required, low attack complexity. No vendor patch available.

Denial Of Service IBM Microsoft +2
NVD
EPSS 0% CVSS 4.6
MEDIUM Monitor

NVIDIA Delegated Licensing Service for all appliance platforms contains a SQL injection vulnerability where an User/Attacker may cause an authorized action. Rated medium severity (CVSS 4.6). No vendor patch available.

Denial Of Service SQLi Nosql Injection +1
NVD
EPSS 0% CVSS 8.6
HIGH PATCH This Week

WhoDB is an open source database management tool. Rated high severity (CVSS 8.6), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

Code Injection Nosql Injection Suse +1
NVD GitHub
EPSS 0% CVSS 8.8
HIGH This Week

A vulnerability exists in the query validation of the MicroSCADA Pro/X SYS600 product. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, low attack complexity. No vendor patch available.

Code Injection Nosql Injection Microscada X Sys600 +2
NVD
EPSS 1% CVSS 6.5
MEDIUM This Month

IBM Db2 for Linux, UNIX and Windows (includes DB2 Connect Server) federated server 10.5, 11.1, and 11.5 is vulnerable to denial of service with a specially crafted query under certain non default. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, low attack complexity. No vendor patch available.

Denial Of Service IBM Microsoft +2
NVD
EPSS 1% CVSS 6.5
MEDIUM This Month

IBM Db2 for Linux, UNIX and Windows (includes Db2 Connect Server) 11.1 and 11.5 is vulnerable to a denial of service, under specific non default configurations, as the server may crash when using a. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, low attack complexity. No vendor patch available.

Denial Of Service IBM Microsoft +2
NVD
EPSS 1% CVSS 6.5
MEDIUM This Month

A vulnerability in the web-based management interface of Cisco SD-WAN vManage Software could allow an authenticated, remote attacker to conduct cypher query language injection attacks on an affected. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, low attack complexity. No vendor patch available.

Information Disclosure Cisco Nosql Injection +2
NVD
EPSS 1% CVSS 6.5
MEDIUM This Month

A vulnerability in the web-based management interface of Cisco SD-WAN vManage Software could allow an authenticated, remote attacker to conduct Cypher query language injection attacks on an affected. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, low attack complexity. No vendor patch available.

Information Disclosure Cisco Nosql Injection +1
NVD
EPSS 1% CVSS 8.1
HIGH PATCH This Week

In Administrate (rubygem) before version 0.13.0, when sorting by attributes on a dashboard, the direction parameter was not validated before being interpolated into the SQL query. Rated high severity (CVSS 8.1), this vulnerability is remotely exploitable, low attack complexity.

SQLi Nosql Injection Administrate +1
NVD GitHub
EPSS 2% CVSS 8.8
HIGH PATCH This Week

Improper Neutralization of Special Elements used in an OS Command in bookmarking function of Newsbeuter versions 0.7 through 2.9 allows remote attackers to perform user-assisted code execution by. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity.

RCE Command Injection Debian +3
NVD GitHub
Prev Page 2 of 2

Quick Facts

Typical Severity
HIGH
Category
web
Total CVEs
101

Related CWEs

MITRE ATT&CK

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy