Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify app endpoint feeding user input to Mongoid query
-
DeliverySubmit crafted JavaScript-expression string criterion
-
ExploitMongoid passes value to DB as server-side JS
-
ExecutionDB engine evaluates attacker code
-
ImpactDisclose stored fields / skew document selection / degrade performance
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires a Mongoid-based application that forwards an externally-influenced value into a string-typed query criterion, which Mongoid then relays to MongoDB as a server-side JavaScript expression (a $where-style predicate) rather than a coerced/typed operator. Exploitation also requires the MongoDB deployment to permit server-side JavaScript evaluation. Limiting factors: the vulnerability is not reachable in default query-building patterns that use typed/hash criteria - it depends on the application accepting raw string criteria from untrusted input, which is an integration-specific condition rather than an out-of-the-box remote flaw. |
| Impact | The vendor CVSS 4.0 vector (8.8, AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:L) rates this high-severity and network-exploitable without privileges, and CWE-94 (Code Injection) frames it as code evaluation in the database engine. However, the true risk is heavily gated: the description states the flaw triggers when 'an unauthenticated party able to influence the value an application supplies as a query argument' passes a string criterion - meaning exploitation depends on a downstream Mongoid-based application forwarding untrusted input directly into a string-typed query criterion that Mongoid then relays as a server-side JavaScript expression ($where-style). That is an application-integration prerequisite the vendor's AT:N does not capture; I assess AT:P / AC:H. No EPSS score, no CISA KEV listing, and no public proof-of-concept were provided - this is 'no public exploit identified at time of analysis.' The 'RCE' tag overstates impact: evaluation occurs inside the MongoDB JavaScript engine (sandboxed to DB context), not OS-level remote code execution, which is consistent with the vendor's own low VI:L/VA:L integrity/availability impact. Net: a genuine injection issue worth patching, but real-world risk is contingent on how consuming apps build queries, not a universally remotely-exploitable default-config bug. |
| Exploit ScenarioDerived | A web application built on Mongoid takes a user-supplied parameter (e.g., a search field) and passes it as a string query criterion without type coercion. An unauthenticated attacker submits a crafted JavaScript expression that Mongoid relays to MongoDB as a server-side JS predicate, causing the DB engine to evaluate attacker-chosen logic to read stored field values or force document selection. No public PoC was provided in the source data. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 18, 2026
Code injection in Mongoid allows unauthenticated attackers who can influence a query argument to execute arbitrary JavaScript in the MongoDB server via a string-typed query criterion, leading to disclosure of stored field values, unintended document selection for writes, and reduced database performance. The vulnerability affects Mongoid versions 8.0.0 through 8.0.12, 8.1.0 through 8.1.12, 9.0.0 through 9.0.11, and 9.1.0, but exploitation requires the application to pass externally influenced string criteria to the query builder and the MongoDB deployment to permit server-side JavaScript evaluation. No public exploit identified at time of analysis.
RemediationAI
No vendor-released patch identified at time of analysis; monitor the MongoDB Jira issue at https://jira.mongodb.org/browse/MONGOID-5993 for updates. As a compensating control, disable server-side JavaScript evaluation in MongoDB by setting security.javascriptEnabled to false or starting the server with --noscripting, which blocks the $where and $function operators and mapReduce JavaScript execution; trade-off: this breaks applications that rely on those features. Ensure Mongoid-based applications never pass raw string criteria from untrusted input to query methods; instead use typed or hash criteria and validate or whitelist any externally influenced query arguments. Additionally, restrict network access to MongoDB instances to trusted clients to reduce exposure.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Mongoid is a Ruby object-document mapper (ODM) for MongoDB. The flaw, classified as CWE-94 code injection, arises because Mongoid does not neutralize string-typed query criteria and instead relays them to MongoDB as server-side JavaScript expressions, such as a $where predicate, rather than coercing them into safe typed operators. This allows any party who can influence the query argument to inject JavaScript that the database engine evaluates. The underlying issue depends on application integration: default query-building patterns that use typed or hash criteria are not vulnerable. Affected CPE is cpe:2.3:a:mongodb_inc.:mongoid:*:*:*:*:*:*:*:*; specific affected versions per ENISA EUVD are 8.0.0 through 8.0.12, 8.1.0 through 8.1.12, 9.0.0 through 9.0.11, and 9.1.0. MongoDB must have server-side JavaScript enabled for exploitation, which is common but can be disabled. The vendor CVSS 4.0 score is 8.8 (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:L), while our independent assessment using CVSS 3.1 yields AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L, reflecting the integration-specific exploitation condition.
Know when Mongoid gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N
AC:H because exploitation requires the app to route untrusted input into a string query criterion and the DB to allow server-side JS; C:H for field disclosure, I:L/A:L for skewed write selection and perf degradation.
Primary rating from Vendor (mongodb).
CVSS VectorVendor: mongodb
DescriptionCVE.org
Mongoid does not neutralize a string-typed query criterion supplied to its query builder, and instead passes it to the database as a server-side JavaScript expression. An unauthenticated party able to influence the value an application supplies as a query argument may cause code of their choosing to be evaluated by the database engine. This may result in unintended disclosure of stored field values, unintended selection of documents for application-initiated writes, and reduced database performance.
Executive ViewAI
Organizations using affected versions of the Mongoid Ruby library (8.0.0 through 8.0.12, 8.1.0 through 8.1.12, 9.0.0 through 9.0.11, and 9.1.0) face a high-severity security flaw that could lead to unauthorized exposure of stored database fields, unintended document modifications, and degraded database performance. No vendor-released patch identified at time of analysis, and no public exploit identified at time of analysis. Leadership should prioritize identifying vulnerable applications and implementing compensating controls to protect sensitive data and maintain service availability.
Disable server-side JavaScript execution in MongoDB (e.g., security.javascriptEnabled=false), enforce strict input validation and parameterized queries for all Mongoid criteria, restrict database user privileges to least privilege, and monitor database logs for anomalous JavaScript execution or unusual document access.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Data disclosure and permanent record deletion in Mongoid can be triggered by an unauthenticated remote attacker when an
CPU exhaustion in MongoDB's Mongoid Ruby ODM allows an unauthenticated remote party to render an embedding application u
Insecure direct object reference in Mongoid's nested-attributes handling lets an authenticated user with basic applicati
Unsafe reflection (CWE-470) in Mongoid's document persistence layer allows a crafted key to be reflected into an interna
Unauthenticated, remote query-operator injection in Mongoid - the official MongoDB object-document mapper for Ruby - all
Silent, warning-free failure of encryption-configuration generation in the Mongoid object-document mapper causes fields
Mongoid can silently persist values in readable form that applications intended to encrypt, because its client-side fiel
Mongoid's automatic client-side encryption can silently store values that an application declared for encryption as clea
EUVD-2026-83214
GHSA-vr6j-ghpr-hmgf
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB