CVE-2026-126837: MongoDB Node.js driver DNS SRV validation bypass

CVE-2026-126837 · Severity: high · CVSS 7.4 · Published 2026-11-12

The MongoDB Node.js driver for connecting to MongoDB databases has a flaw in how it validates DNS responses when using mongodb+srv:// connection strings. An attacker who can intercept or forge DNS responses could redirect the driver to connect to a malicious server, potentially exposing database credentials and application data. Standard encryption does not prevent this attack because the driver accepts the certificate from the attacker's redirected host.

Technologies: MongoDB Node.js Driver. Vendors: MongoDB.

Quick answers

Is CVE-2026-126837 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-126837 being exploited in the wild.
How severe is CVE-2026-126837?
High severity, with a CVSS score of 7.4, published 12 November 2026.
Which products and versions are affected?
MongoDB Node.js Driver before 7.8.0.
Is there a fix for CVE-2026-126837?
Yes: fixed in 7.8.0. Until then: Use mongodb:// connection strings instead of mongodb+srv:// URIs, or implement custom DNS validation through the new srvHostValidator callback option to restrict connections to whitelisted domains. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-126837 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-126837?
Check whether you run MongoDB Node.js Driver at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: 7.8.0

Use mongodb:// connection strings instead of mongodb+srv:// URIs, or implement custom DNS validation through the new srvHostValidator callback option to restrict connections to whitelisted domains.

Technical details

The MongoDB Node.js driver insufficiently validates hostnames in DNS SRV responses for mongodb+srv:// URIs, allowing an unauthenticated attacker with network access to DNS responses to redirect connections to arbitrary hosts. The vulnerability exploits improper hostname validation where certain characters terminate the hostname early, combined with the driver accepting the TLS certificate for the redirected hostname. This requires the attacker to be able to forge or modify DNS SRV responses and only affects mongodb+srv:// connection strings; mongodb:// URIs are unaffected.

Affected products

  • MongoDB Node.js driver before 7.8.0

Timeline

  • 2026-11-12: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.