Skip to content
MongoDBGHSA-v86x-jf74-vqfx

Cross-database write retargeting via unvalidated dotted database name in Client.BulkWrite

High7.1CVE-2026-81521 · Published Aug 27, 2026

### Impact When calling [Client.BulkWrite](https://pkg.go.dev/go.mongodb.org/mongo-driver/v2@v2.8.1/mongo#Client.BulkWrite), a caller-controlled database name containing period ('.') may be interpreted as a different namespace when forwarded to MongoDB. This could redirect operations to a database or collection other than the one intended by the application. ### Patches Upgrade to Go Driver v2.8.2 or later. ### Workarounds Users can manually validate database and collection names before calling [Client.BulkWrite](https://pkg.go.dev/go.mongodb.org/mongo-driver/v2@v2.8.1/mongo#Client.BulkWrite) using code like the following. ```go func validateBulkWrites(writes []mongo.ClientBulkWrite) error { for i, w := range writes { if strings.ContainsRune(w.Database, '.') { return fmt.Errorf( "invalid database name %q in write %d: database names cannot contain '.'", w.Database, i, ) } } return nil } ``` ### References * [GODRIVER-4075](https://jira.mongodb.org/browse/GODRIVER-4075) * https://github.com/mongodb/mongo-go-driver/blob/v2.8.1/mongo/client.go#L954-L964

GitHub advisory

Affected versions

PackageAffectedFixed in
go.mongodb.org/mongo-driver/v2/mongo
Go
>= 2.1.0, < 2.8.22.8.2
Details and references
CVSS 4.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Severity from
GitHub (reviewed advisory)

More MongoDB advisories

All MongoDB

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.