# GHSA-29QR-P9GM-XFVF: Authentication identity smuggling via NUL-byte injection in SASL PLAIN payload

- Database: GitHub
- Severity: CVSS 6.3 (Medium)
- Published: 2026-11-19
- Modified: 2026-11-19

## Tracked as

- [CVE-2026-129935](https://cve.now/CVE-2026-129935.md): MongoDB Go Driver auth identity confusion in SASL PLAIN credentials

## Affected versions

- go.mongodb.org/mongo-driver/mongo (Go): from 1.0.0
- go.mongodb.org/mongo-driver/v2/mongo (Go): from 2.0.0, through 2.10.0

## Description

### Impact

The Go Driver does not reject `\x00` characters in a `PLAIN` username or password. The SASL PLAIN message separates its fields with `\x00`, so an embedded `\x00` changes where the fields split, and consequently the server can authenticate a different user, or check different a password, than the application intended.

Applications are affected if they use `PLAIN` authentication and build the username or password from untrusted input. The attacker still needs valid database credentials for the user the server authenticates: this only bypasses the application's authorization policy, such as a tenant suffix or a deny-list, not database authentication.

### Workarounds
Users can reject `\x00` characters before connecting:

```go
opts := options.Client().ApplyURI(uri)
if cred := opts.Auth; cred != nil &&
        (strings.ContainsRune(cred.Username, 0) || strings.ContainsRune(cred.Password, 0)) {
        return errors.New("username and password cannot contain NUL characters")
}
```
### Proof of Concept
Before 2.10.1, an application that builds `username = user_input + "@tenant1.example"` and receives a `user_input` of `admin\x00secret\x00` would produce this payload:

```
"\x00" + "admin\x00secret\x00@tenant1.example" + "\x00" + "<password>"
```

which splits into five `NUL`-separated fields: 

```
"" \x00 "admin" \x00 "secret" \x00 "@tenant1.example" \x00 "<password>"
```

So mongod's built-in `PLAIN` mechanism reads the username as `admin` and the password as `secret`, and anything after the third `\x00` is ignored, bypassing the application's intended tenant restriction.

### References
[GODRIVER-4120](https://jira.mongodb.org/browse/GODRIVER-4120)

## References

- https://github.com/mongodb/mongo-go-driver/security/advisories/GHSA-29qr-p9gm-xfvf

Page: https://cve.now/GHSA-29QR-P9GM-XFVF
