CVE-2026-18708
MongoDB vulnerability analysis and mitigation

Overview

CVE-2026-18708 is a code injection vulnerability in MongoDB Server's JavaScript scripting engine that allows an authenticated user with write privileges to execute attacker-controlled code within the query scope of other users. The vulnerability is triggered through a specially crafted stored value processed during an internal maintenance cycle. Affected versions include MongoDB Server 7.0 before 7.0.40, 8.0 before 8.0.29, and 8.3.0 before 8.3.8. It was published on August 11, 2026, with a CVSS v3.1 base score of 6.4 (Medium) and a CVSS v4.0 base score of 5.3 (Medium) (GitHub Advisory).

Technical details

The root cause is classified as CWE-94 (Improper Control of Generation of Code / Code Injection), where MongoDB's JavaScript scripting engine fails to properly isolate stored values from being evaluated as executable code during internal maintenance cycles (GitHub Advisory). An attacker with write access to a database can store a specially crafted value that, when processed by the maintenance cycle, executes within the JavaScript engine's sandbox in the context of other users' queries. Exploitation requires authenticated access with write privileges; no user interaction from the victim is needed. The attack is network-accessible and of low complexity, but impact is bounded by the scripting engine's sandbox, which does not expose database, filesystem, or network resources (GitHub Advisory).

Impact

Successful exploitation allows an authenticated attacker to corrupt query results for other users sharing the same database instance and to cause denial of service targeting their database operations. The impact is confined to the JavaScript scripting engine's execution sandbox — there is no access to underlying database files, the filesystem, or network resources, limiting confidentiality impact to none. Integrity and availability are both assessed as low, affecting only the vulnerable system's query processing rather than enabling broader lateral movement or data exfiltration (GitHub Advisory).

Exploitability

As of the publication date, there is no known public proof-of-concept exploit and no evidence of active in-the-wild exploitation (GitHub Advisory). The EPSS score is approximately 0.284% (21st percentile), indicating a low near-term probability of exploitation. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. NVD SSVC assessment classifies exploitation as "none" and the attack as non-automatable.

Exploitation steps

  1. Gain authenticated access: Obtain credentials for a MongoDB account with write privileges on a target database (e.g., via credential theft, phishing, or a compromised application account).
  2. Craft a malicious stored value: Construct a specially crafted document or field value containing a JavaScript payload designed to execute within MongoDB's scripting engine sandbox when evaluated.
  3. Write the payload to the database: Insert or update a document in the target collection with the malicious value using standard MongoDB write operations (e.g., db.collection.insertOne() or db.collection.updateOne()).
  4. Wait for internal maintenance cycle: The MongoDB Server's internal maintenance process will eventually process the stored value, triggering execution of the attacker's JavaScript code within the query scope of other users.
  5. Achieve impact: The executed code corrupts query results returned to other users or causes denial of service for their ongoing database operations on the same instance (GitHub Advisory).

Indicators of compromise

  • Logs: Unexpected JavaScript errors or anomalous scripting engine activity in MongoDB server logs (mongod.log) during maintenance cycle execution; unusual query result anomalies reported by multiple users on the same database instance.
  • Database: Presence of documents with unusual or obfuscated JavaScript-like content in field values, particularly in collections accessible to lower-privileged users; unexpected modifications to documents not attributable to normal application activity.
  • Process: Abnormal CPU spikes or query latency increases during MongoDB's internal maintenance cycles, potentially indicating heavy JavaScript evaluation.
  • Network: Repeated authenticated write operations from unexpected source IPs or user accounts, particularly targeting shared multi-tenant databases (GitHub Advisory).

Mitigation and workarounds

MongoDB has released patched versions addressing this vulnerability: 7.0.40, 8.0.29, and 8.3.8. Users should upgrade to these versions as the primary remediation (GitHub Advisory). As interim workarounds, restrict write privileges to only trusted and verified users, apply the principle of least privilege for all database accounts, and consider isolating critical databases to separate MongoDB instances where write access cannot be sufficiently controlled. Monitor for unusual query patterns or anomalies during maintenance cycles as a detection measure.

Additional resources


SourceThis report was generated using AI

Related MongoDB vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-18712HIGH7.2
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesAug 11, 2026
CVE-2026-18711HIGH7.1
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesAug 11, 2026
CVE-2026-18709MEDIUM5.9
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesAug 11, 2026
CVE-2026-18708MEDIUM5.3
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesAug 11, 2026
CVE-2026-18707MEDIUM5.3
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesAug 11, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management