Skip to content

Releases

.NET Driver Version 3.14.1 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 19 Nov 22:39
8d8853d

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.

.NET Driver Version 3.14.0 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 12 Nov 22:55
802f2e0

Important

This release addresses two CVEs in how the driver decides which types may be created from type discriminators in the database. The driver is now stricter in two ways: it detects compiler-generated anonymous types more precisely, and when allowed types are defined by assembly it also checks generic arguments and array element types. Both changes can cause deserialization that previously succeeded to throw until the types involved are explicitly allowed, so review the notes below before upgrading.
This release also removes the prefixPreview, suffixPreview and substringPreview APIs, which is an unrelated breaking change.

This is the general availability release for the 3.14.0 version of the driver.

Security fixes:

  • CSHARP-6160 / CVE-2026-126982: Types specified by a type discriminator are now checked recursively when the allowed types are defined by assembly
    • Behavior change: When deserializing a type specified by a type discriminator using ObjectSerializerAllowedTypesConvention(params Assembly[]), generic type arguments and array element types are now checked as well as the generic definition. Types that were previously allowed only because their generic definition was in an allowed assembly might now throw until their type arguments are also allowed.
  • CSHARP-6169 / CVE-2026-126839: Anonymous type detection is now more rigorous
    • Behavior change: When deserializing types, a type is now treated as a compiler-generated anonymous type only if it matches the compiler's naming pattern, is compiler-generated, and has only fields and properties typed by its generic parameters. Types that are not anonymous types but resemble them might now throw on deserialization until they are explicitly allowed.

Breaking changes:

  • CSHARP-6137: Drop prefixPreview, suffixPreview, and substringPreview APIs

Fixes:

  • CSHARP-6181: Reject @<current> and @<elem> filter field names that collide with path markers

Maintenance:

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.13.0 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 22 Oct 18:45

Important

This release addresses a number of CVEs reported against the driver, along with a small number of related fixes. Several fixes make the driver stricter about invalid input: it now rejects malformed raw BSON, out-of-range binary subtypes, GeoJSON extra members that collide with declared members, replacement documents that start with an operator, and LINQ field names that the server would reinterpret. A few generated updates and schema patterns also change shape, and BsonSymbolTable and one CSFLE PatternProperty overload are now marked obsolete. Please review the behavior changes listed under each security fix below before upgrading.

This is the general availability release for the 3.13.0 version of the driver.

Security fixes:

  • CSHARP-6157 / CVE-2026-114646: NoSQL command injection via mismatched raw BSON length prefix written verbatim to the wire
    • Behavior change: writing a raw BSON document or array now throws ArgumentException if its declared length is inconsistent with the buffer. Bytes past the declared length are ignored.
  • CSHARP-6162 / CVE-2026-114644: Memory-exhaustion denial of service via unbounded symbol interning during BSON/JSON deserialization
    • Behavior change: BsonSymbol values are no longer interned and BsonSymbolTable is marked obsolete. Use BsonSymbol.Create or the implicit string conversion instead. Equality still compares by name; only reference identity changes.
  • CSHARP-6166 / CVE-2026-114654: BSON output corruption via out-of-range binary subtype bypassing UUID and OldBinary guards
    • Behavior change: BsonBinaryData, the JSON reader (BinData, HexData and legacy $type) and the binary writer now reject binary subtypes outside 0 to 255.
  • CSHARP-6168 / CVE-2026-114652: Update operator injection via single-element list rewriting in the update builder
    • Behavior change: PushEach and AddToSetEach with a single value now always render $each, and PullAll with a single value now always renders $pullAll. Previously a single value was unwrapped or rendered as $pull.
  • CSHARP-6170 / CVE-2026-114651: Cross-document data leak via malformed BSON array parsing in reused thread buffer
  • CSHARP-6174 / CVE-2026-114653: Silent client-side encryption bypass via unescaped field-name regex in CSFLE schema builder
    • Behavior change: the PatternProperty overload that takes a field expression is now obsolete; use Property to configure a specific field. Field names passed to PatternProperty are now matched both as literal field names and as regular expressions.
  • CSHARP-6179 / CVE-2026-114643: Geometry override via duplicate-key BSON injection through GeoJSON extra members
    • Behavior change: GeoJSON serialization now throws BsonSerializationException when an extra member has the same name as a declared member.
  • CSHARP-6180 / CVE-2026-114650: Plaintext exposure of encrypted fields via ANSI code-page corruption of database name
    • Behavior change: automatic encryption now passes the database name to libmongocrypt as UTF-8 instead of the Windows ANSI code page, so databases with non-ASCII names match schema map namespaces correctly.
  • CSHARP-6181 / CVE-2026-114648: Query redirection via unvalidated string keys spliced into LINQ filter field paths
    • Behavior change: LINQ translation now throws NotSupportedException for dictionary keys, BsonDocument keys and Mql.Field names that the server would reinterpret: names containing ".", names starting with "$" at the start of a path, and positional operators.
  • CSHARP-6184 / CVE-2026-114649: Authentication bypass via issuer-and-serial-only certificate equality in shared cluster cache
    • Behavior change: client certificate comparison in SslSettings, which decides whether clients share a cluster, now compares the full certificate (SHA-256 hash) and whether a private key is present, instead of only issuer and serial number.
  • CSHARP-6186 / CVE-2026-114647: NoSQL operator injection via unvalidated replacement document in findOneAndReplace
    • Behavior change: FindOneAndReplace now throws ArgumentException when the first element name of the replacement document starts with $, consistent with ReplaceOne.

Improvements:

  • CSHARP-5030: Only modify TCP buffer sizes if explicitly configured

Fixes:

  • CSHARP-6237: LINQ Concat throws NullReferenceException when the second queryable has no pipeline stages
  • CSHARP-6257: Fix WithTransaction not retrying TransientTransactionError when MongoClientSettings is created with its constructor
  • CSHARP-6220: Prevent cancellation-token retention in pre-.NET 6 WaitAsync

Maintenance:

  • CSHARP-6225: Latest server binary downloads require private S3
  • CSHARP-6263: Fix incorrect XML doc summaries for PullAll and Pop update builders

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.12.0 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 17 Sep 23:00
5f1ad96

This is the general availability release for the 3.12.0 version of the driver.

The main new features in 3.12.0 include:

  • CSHARP-6214: Implement srvAllowedHostsSuffix URI option

Fixes:

  • CSHARP-6223: Fix client-side projection crash on member-init projections

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.11.2 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 10 Sep 19:38

Important

This is a security patch release. It addresses two CVEs reported against the driver, along with a small number of related fixes. There are no public API changes and no application code changes are required to upgrade. Note that the shape of some queries generated by the LINQ provider and by GridFS has changed — see the individual tickets below.

This is a patch release that contains fixes and stability improvements:

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.11.1 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 27 Aug 21:48

Important

This is a security patch release. It addresses a number of CVEs reported against the driver and does not include any functional changes or API modifications. Upgrading is recommended for all users; no code changes are required on the application side.

This is a patch release that contains fixes and stability improvements:

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.11.0 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 12 Aug 14:16
d9c3c29

This is the general availability release for the 3.11.0 version of the driver.

The main new features in 3.11.0 include:

Fixes:

  • CSHARP-6125: Reject non-collection inner sequences in LINQ Join/LeftJoin

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.10.0 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 08 Jul 01:54
3e1d126

This is the general availability release for the 3.10.0 version of the driver.

Important

In-Use Encryption String (renamed from Text) API GA

The GA API requires mongodb server version 9.0. The preview API can continue to be used with pre-9.0 server versions.

The main new features in 3.10.0 include:

  • CSHARP-6017: Support LINQ LeftJoin for joins and includes
  • CSHARP-3791: Allow hint for unacknowledged writes using OP_MSG when supported by the server
  • CSHARP-5826: Add $top, $bottom, $topN and $bottomN expression operators
  • CSHARP-6024: Support ReadOnlySet Serialization
  • CSHARP-6020: Add builders for the doesNotAffect field for in, range, equals and compound Atlas Search operators
  • CSHARP-4216: Support $topN and similar accumulators in $setWindowFields
  • CSHARP-5750: Add support for new QE prefix/substring/suffix aggregation expression operators
  • CSHARP-5495: Support $concatArrays and $setUnion aggregation accumulators
  • CSHARP-6041: Add $setWindowFields support for the $minMaxScaler window operator
  • CSHARP-6091: Support checked arithmetic operators in LINQ translation
  • CSHARP-5984: Add QE prefix+suffix GA and rename API to string
  • CSHARP-6105: Add QE substring GA
  • CSHARP-5693: Allow Instantiated MongoClients to Send Client Metadata On-Demand

Improvements:

  • CSHARP-6094: Use minimum supported wire version for CompatibilityLevel when null
  • CSHARP-5964: Investigate a way to read into BsonBinaryData property if it's missed in the stored document
  • CSHARP-6093: Compile one-shot LINQ eval lambdas with preferInterpretation
  • CSHARP-6096: Optimize AsyncCursor<> disposal to consume less resources

Fixes:

  • CSHARP-5816: Insonsistent behavior of EnsureNoMemberMapConflicts for discriminator convention
  • CSHARP-5740: Remove duplicate read concern for operations in snapshot sessions
  • CSHARP-5846: Global GuidSerializer settings ignored for object-typed properties
  • CSHARP-5658: Queries using Equals with different types throw
  • CSHARP-6066: FilteredMongoCollectionBase.FindOneAndUpdate throws NullReferenceException when options is null
  • CSHARP-6080: Pool clear with closeInUseConnections leaks raw ObjectDisposedException to the application instead of a retryable connection error

Maintenance:

  • CSHARP-5746: Update $lookup prose test for MONGOCRYPT-793
  • CSHARP-6062: Add empty permissions section to PR workflow
  • CSHARP-6007: Mark Server version 4.2 as EOL from driver's PoV (Min server version as 4.4, minWireVersion as 9)
  • CSHARP-5992: Add LINQ translation benchmark suite
  • CSHARP-6030: Add case and diacritic sensitivity prose tests for text explicit encryption
  • CSHARP-5943: Add per-area AGENTS.md files and reviewer sub-agents
  • CSHARP-6071: Script to create a local Docker container with a single replica set
  • CSHARP-6100: Clarify status and semver treatment for shipped IWM driver APIs

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.9.0 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 27 May 20:52
8297e62

This is the general availability release for the 3.9.0 version of the driver.

Important

Next minor release will raise the minimum supported MongoDB Server version from 4.2 to 4.4. This is in accordance with MongoDB Software Lifecycle Schedules. Support for MongoDB Server 4.2 will be dropped in a future release!

Breaking changes:

  • CSHARP-5629: Respect BsonElement attribute in NamedIdMemberConvention. A member named Id, id or _id with a [BsonElement("...")] attribute naming anything other than _id is no longer mapped as the document id. Previously the attribute was ignored and the member was stored as _id. Applications that relied on this will no longer read existing documents correctly, and new writes store the value in a separate field. To restore the previous mapping, remove the attribute or replace it with [BsonId]. See the ticket for details.

The main new features in 3.9.0 include:

  • CSHARP-5567: Add a LINQ equivalent for $toHashedIndexKey
  • CSHARP-4901: Add support for SearchMeta facet without operator
  • CSHARP-5930: Allow registering the same encryption provider multiple times
  • CSHARP-5899: Add support for "flat" indexing method in vector search index builders
  • CSHARP-5931: Add builder support for $scoreFusion stage

Improvements:

  • CSHARP-3556: Use EndPointServerSelector in SingleServerBinding instead of busy wait
  • CSHARP-5611: Support ReadOnlySpan in ObjectId and eliminate the temporary byte array allocations

Fixes:

  • CSHARP-5967: Ensure SerializerFinder proper support of Parse method
  • CSHARP-5966: Add support of string.TrimStart and TrimEnd methods to SerializerFinder
  • CSHARP-5942: Fix serializer resolution for dictionary paths with numeric string keys
  • CSHARP-2868: Allow maxIdleTimeMS=0 and treat it as no idle time limit
  • CSHARP-5762: Avoid changing "filter" to "parentFilter" in previously supported case
  • CSHARP-6029: Execute endSessions on ServerSessionPool close
  • CSHARP-6043: NullReferenceException in IEnumerableSerializerBase.Serialize when projecting nullable array with conditional Select
  • CSHARP-6040: Fix StackOverflowException in convention CouldApply on self-referencing IEnumerable<T> types

Maintenance:

  • CSHARP-6055: Update SharpCompress to remedy vulnerability
  • CSHARP-6023: Update libmongocrypt URLs for 1.18.0+
  • CSHARP-5943: Initial small AGENTS.md file for the C# driver
  • CSHARP-5671: Replace Artifactory with ECR for container image pulls

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

Documentation on the .NET driver can be found here.

.NET Driver Version 3.8.1 Release Notes

Choose a tag to compare

@sanych-sun sanych-sun released this 11 May 23:28
67b17d3

This is a patch release that addresses a security issue:

Known warning when restoring: SharpCompress NU1902

When restoring a project that references this driver with the .NET 8 SDK or newer, NuGet may emit the NU1902 audit warning for the transitive SharpCompress 0.30.1 dependency (GHSA-6c8g-7p36-r338 — directory traversal via IArchive.WriteToDirectory()). The driver does not use that API; SharpCompress is only used for in-memory ZLib stream compression of MongoDB wire-protocol messages, so the driver's usage does not expose consumers to this advisory. This issue will be addressed in an upcoming release (CSHARP-6037).

Documentation on the .NET driver can be found here.

⌂ 换网址