Alert

Logo de MongoDB

Alert 2026-179 Critical vulnerabilities in MongoDB C# and Java drivers allow connection redirection and credential theft

Affected product(s): 

ProductAffected versionsFix
MongoDB C# Driver2.5.0 up to, but not including, 3.14.13.14.1
MongoDB Java Driver3.6.0 up to, but not including, 5.13.05.13.0 (5.15.0 is recommended)
MongoDB Node.js Driver3.3.3 up to, but not including, 7.8.07.8.0

Only applications that connect with mongodb+srv:// strings are affected; the vendor has not published equivalent flaws for other drivers as of this date.

Description

Two critical vulnerabilities have been reported in the official MongoDB drivers for C# and Java, identified as CVE-2026-129938 and CVE-2026-129932, both with CVSS 9.1, critical. Both affect the validation of DNS SRV records that the drivers query when the application uses a mongodb+srv:// connection string. An unauthenticated attacker who can control or forge those DNS responses can cause the driver to connect to a server outside the authorized domain and under the attacker’s control. The vendor made them public on Nov 19, 2026. This bulletin is classified as CRITICAL.

In the C# driver (CVE-2026-129938), a manipulated SRV record can add an external host to the server list. In the Java driver (CVE-2026-129932), the host name that is validated does not match the one used to connect, and the driver ends up verifying the TLS certificate against the attacker’s server, so encryption does not prevent the attack.

If the attack succeeds, the application’s traffic may pass through the attacker’s server. This can expose database credentials and application data, and allow forged query results to be returned. To exploit these flaws, the attacker needs to control or forge the victim’s DNS SRV responses, for example from the same network or by compromising a DNS server.

The vendor also fixed a similar flaw in the Node.js driver, identified as CVE-2026-126837, with CVSS 9.1, critical, published on Nov 12, 2026. It affects versions from 3.3.3 up to, but not including, 7.8.0. In that case, a flaw in the validation of hosts returned by DNS SRV can redirect the connection to a host outside the expected domain; TLS encryption does not prevent this either. Applications that use mongodb:// strings are not affected by this CVE.

On Nov 19, 2026 the vendor also published other medium-severity flaws in these drivers, which are not the main subject of this bulletin: in C#, CVE-2026-129936, CVSS 5.7, medium, and CVE-2026-129937, CVSS 6.3, medium, both fixed in 3.14.1; in Java, CVE-2026-129931, CVSS 5.7, medium, and CVE-2026-129933, CVSS 6.3, medium, both fixed in 5.15.0.

As of the date of this bulletin, CVE-2026-129938, CVE-2026-129932 and CVE-2026-126837 are not listed in the Known Exploited Vulnerabilities catalog and no public proof of concept was identified. No active exploitation is known.

Mitigation

Inventory applications that use the official MongoDB drivers for C#, Java or Node.js with mongodb+srv:// strings, and record the version of each driver.

The fix is to update to the versions listed in Solution. The vendor did not publish a workaround.

As an exposure-reduction measure, and not as a vendor workaround, use trusted internal DNS resolvers, and DNSSEC where possible, to make it harder to forge SRV responses. While updating, consider using mongodb:// strings with an explicit host list, which avoids the SRV lookup. If DNS manipulation on the network is suspected, rotate the database credentials.

Solution

The solution is to update the drivers to the versions published by the vendor, or to a later one:

  • MongoDB C# Driver: 3.14.1 or later, published on Nov 19, 2026. This version also fixes CVE-2026-129936 and CVE-2026-129937. It introduces a breaking change: the ToString() method of MongoUrl, MongoUrlBuilder and ConnectionString now returns the URL with sensitive data hidden (<redacted>). Code that uses that ToString() result as a connection string, key or identifier will break and must be adjusted: for MongoUrl, use url.Url; for MongoUrlBuilder, builder.ToMongoUrl().Url; for ConnectionString, keep the original string, because there is no public way to recover the unredacted string.
  • MongoDB Java Driver: CVE-2026-129932 has been fixed since 5.13.0, published on Sep 25, 2026; installations on that version or later are already protected against this CVE. Updating to 5.15.0 or later, published on Nov 19, 2026, is recommended, as it also fixes CVE-2026-129931 and CVE-2026-129933.
  • MongoDB Node.js Driver: 7.8.0 or later.

The vendor did not publish a workaround.

For information on how to update, visit the following link:

https://github.com/mongodb/mongo-csharp-driver/releases/tag/v3.14.1

Additional information: