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
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| go.mongodb.org/mongo-driver/v2/mongo Go | >= 2.1.0, < 2.8.2 | 2.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| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Aug 27 | NoSQL injection via array replacement bypassing update shape validation in driver write path | Medium5.4 | 3.11.1 |
| Aug 27 | NoSQL injection in LINQ pipeline translation | Medium6.5 | 3.11.1 |
| Aug 27 | KMS master key exposure via unredacted credential serialization in driver settings string | Medium5.6 | 3.11.1 |
| Aug 27 | Connection-option injection via unescaped settings in the canonical MongoDB URL builder | High7.1 | 3.11.1 |
| Aug 27 | Cross-tenant database retargeting via dot/NUL injection in namespace strings in the PHP Driver | High8.1 | 1.21.4+1 more |
| Aug 27 | Cross-database write redirection via unvalidated dotted database name in bulk write namespaces | Medium6.5 | 3.8.2 |