# GHSA-37G5-R4M2-3G5M: Authentication identity smuggling via NUL-byte injection in SASL PLAIN payload

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2026-11-19
- Modified: 2026-11-19

## Tracked as

- [CVE-2026-129937](https://cve.now/CVE-2026-129937.md): MongoDB C# Driver authentication identity confusion in SASL PLAIN login

## Affected versions

- MongoDB.Driver (NuGet): from 2.0.0, fixed in 3.14.1

## Description

### Summary

The MongoDB .NET/C# Driver did not neutralize NUL characters in the user name and password values it placed into the message it builds for SASL PLAIN authentication. A party who can choose the login values that an application passes to the driver can alter where the fields of that message begin and end. This may result in a receiving system reading a login name and secret that differ from the values the application supplied. Authenticating as a different account still requires that account's password. Only deployments that use SASL PLAIN authentication are affected.
### Impact

Applications that use `MONGODB`-`PLAIN` authentication and that pass attacker-influenced values as the username or password. Exploitation is of low likelihood: the attacker needs valid credentials for the identity being targeted, but the consequence is authentication as a different identity.

Applications that do not use PLAIN authentication are not affected.

### Patches

Fixed in `MongoDB.Driver` 3.14.1. The driver now rejects PLAIN usernames and passwords that contain a NUL character with an `ArgumentException`, both when the credential is created in code (for example `MongoCredential.CreatePlainCredential`) and when it is parsed from a connection string.

**Behavior change:** PLAIN credentials containing a NUL character that were previously accepted will now throw `ArgumentException`.

### Workarounds

Validate that usernames and passwords supplied to PLAIN authentication do not contain NUL characters before passing them to the driver.

### References

[CSHARP-6221](https://jira.mongodb.org/browse/CSHARP-6221) / [CVE-2026-129937](https://www.cve.org/CVERecord?id=CVE-2026-129937)

## References

- https://github.com/mongodb/mongo-csharp-driver/security/advisories/GHSA-37g5-r4m2-3g5m

Page: https://cve.now/GHSA-37G5-R4M2-3G5M
