CVE-2026-13078
MongoDB vulnerability analysis and mitigation

Overview

CVE-2026-13078 is a file disclosure vulnerability in MongoDB Server caused by the server-side MozJS (SpiderMonkey) scripting engine unconditionally registering a module loading hook that enables JavaScript calls to read arbitrary files from the host filesystem using the mongod process's privileges. An authenticated user can exploit this through crafted aggregation pipeline commands to access sensitive files on the server. Affected versions include MongoDB Server 7.0 before 7.0.39, 8.0 before 8.0.28, 8.2.0 before 8.2.12, and 8.3.0 before 8.3.7. The vulnerability was published on July 22, 2026, and carries a CVSS v3.1 base score of 7.7 (High) and a CVSS v4.0 base score of 6.3 (Medium) (GitHub Advisory, EUVD).

Technical details

The root cause is classified as CWE-862 (Missing Authorization): the MozJS scripting engine within MongoDB's server-side JavaScript execution environment unconditionally registers a module loading hook without enforcing proper authorization controls, allowing it to be invoked by any authenticated database user (GitHub Advisory). An attacker with valid database credentials can craft aggregation pipeline commands that invoke JavaScript via the $function or similar operators, leveraging the registered hook to call Node-style require() or equivalent module loading mechanisms to read arbitrary files from the filesystem with the privileges of the mongod process. The attack vector is network-based, requires low privileges (authenticated access), no user interaction, and no special attack complexity or requirements. No public proof-of-concept code has been identified at this time (Feedly).

Impact

Successful exploitation allows an authenticated attacker to read arbitrary files accessible to the mongod process on the host filesystem, potentially exposing sensitive data such as configuration files, private keys, credentials, /etc/passwd, application secrets, or other files within the process's read permissions. The impact is limited to confidentiality — there is no integrity or availability impact on the vulnerable system itself, though the subsequent system confidentiality impact is rated High due to the potential for sensitive data exposure beyond the database (GitHub Advisory). If MongoDB is running with elevated OS privileges, the scope of file disclosure could be significant and may facilitate lateral movement or privilege escalation in broader environments.

Exploitation steps

  1. Reconnaissance: Identify MongoDB Server instances running affected versions (7.0 < 7.0.39, 8.0 < 8.0.28, 8.2.0 < 8.2.12, 8.3.0 < 8.3.7) using network scanning tools such as Shodan, Censys, or nmap targeting default MongoDB port 27017.
  2. Obtain Credentials: Acquire valid MongoDB user credentials through phishing, credential stuffing, leaked secrets, or by using a low-privilege account (e.g., a read-only database user).
  3. Connect to MongoDB: Authenticate to the target MongoDB instance using the mongo shell or a MongoDB driver with the obtained credentials.
  4. Craft Malicious Aggregation Pipeline: Construct an aggregation pipeline command that invokes server-side JavaScript execution (e.g., using $function or mapReduce) and leverages the unconditionally registered MozJS module loading hook to call file-reading functionality.
  5. Read Arbitrary Files: Execute the crafted pipeline to read target files from the host filesystem (e.g., /etc/passwd, MongoDB configuration files, TLS private keys, or application credential files) using the privileges of the mongod process.
  6. Exfiltrate Data: Collect the file contents returned in the query results and exfiltrate them for further exploitation or lateral movement (GitHub Advisory, Feedly).

Indicators of compromise

  • Network: Authenticated connections to MongoDB (port 27017 or custom) from unexpected or external IP addresses; unusual query volumes from a single authenticated user.
  • Logs: MongoDB audit logs showing aggregation pipeline commands (aggregate) with embedded JavaScript ($function, $where, or mapReduce) from non-administrative users; repeated access to collections not typically queried by the connecting user.
  • Process: The mongod process accessing sensitive OS files (e.g., /etc/passwd, /etc/shadow, TLS certificate/key files, application config files) — detectable via OS-level file access auditing (e.g., auditd on Linux with -w /etc/passwd -p r).
  • File System: No direct file system artifacts expected from read-only exploitation, but evidence of reconnaissance may appear in MongoDB's mongod.log as unusual aggregation queries with JavaScript payloads.

Mitigation and workarounds

MongoDB has released patched versions addressing this vulnerability: 7.0.39, 8.0.28, 8.2.12, and 8.3.7 — upgrading to these versions is the primary recommended remediation (GitHub Advisory, MongoDB JIRA). As interim mitigations, restrict database access to trusted and necessary users only, enforce the principle of least privilege for MongoDB accounts, and disable server-side JavaScript execution if not required (using --noscripting or security.javascriptEnabled: false in the configuration). Implement network segmentation to limit access to MongoDB instances from only authorized application servers, and monitor aggregation pipeline queries for suspicious JavaScript-based file access patterns.

Community reactions

The vulnerability was noted on Mastodon by The Hacker Wire shortly after disclosure on July 22, 2026 (Mastodon). The GitHub Advisory Database has classified it as Moderate severity and it has been indexed by multiple CVE tracking services. No significant vendor statements beyond the MongoDB JIRA ticket or major media coverage have been identified at this time.

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-9737HIGH7.1
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesJul 22, 2026
CVE-2026-13077HIGH7.1
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesJul 22, 2026
CVE-2026-13076HIGH7.1
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesJul 22, 2026
CVE-2026-13075HIGH7.1
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesJul 22, 2026
CVE-2026-13078MEDIUM6.3
  • MongoDB logoMongoDB
  • cpe:2.3:a:mongodb:mongodb
NoYesJul 22, 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