github mongodb/mongo-csharp-driver v3.14.1
.NET Driver Version 3.14.1 Release Notes

one hour ago

Important

This release addresses several CVEs and contains breaking changes. Please find more details below.

  • CSHARP-6221 / CVE-2026-129937: Authentication identity smuggling via NUL-byte injection in SASL PLAIN payload
    Creating or parsing a PLAIN credential whose username or password contains a NUL (\0) character now throws ArgumentException.

  • CSHARP-6205 / CVE-2026-129936: Credential exposure via sensitive connection string values included in parse-error messages

    • ToString() on MongoUrl, MongoUrlBuilder and ConnectionString now returns a redacted URL. Usernames, passwords and other sensitive values become <redacted>.
    • MongoServerAddress.ToString() and MongoCredential.ToString() now return fixed type names, so they no longer expose host, port or username.
    • MongoClientSettings.ToString() no longer includes server addresses or credential details.
    • Exception messages from connection-string parsing, SRV validation, address parsing and authentication no longer include user-supplied values.

    Action required. Any code that uses these ToString() results as a connection string, key or identifier will break:

    • MongoUrl: replace url.ToString() with url.Url.
    • MongoUrlBuilder: replace builder.ToString() with builder.ToMongoUrl().Url. Passing builder.ToMongoUrl() straight to new MongoClient(...) also works.
    • ConnectionString: there is no public way to get the unredacted string back. Keep the original string you passed in.
    • MongoServerAddress: use $"{address.Host}:{address.Port}" instead of ToString().
    • MongoCredential: read credential.Username and credential.Source instead of ToString().
  • CSHARP-6283 / CVE-2026-129938: SRV host normalization logic should be explicit
    Hostnames used with mongodb+srv:// are now validated after normalization. This covers the seed host and the hosts returned by SRV lookups, including periodic re-resolution. This is normally a non-issue, since valid DNS names are unaffected.

  • CSHARP-6216: Wrong regex produced for String.IndexOfAny with an empty or null char array

The full list of issues resolved in this release is available at CSHARP JIRA project.

Documentation on the .NET driver can be found here.

Don't miss a new mongo-csharp-driver release

NewReleases is sending notifications on new releases.