AI and data stack advisories

Severe, 6 weeks1496Projects326

1496 severe, 6 weeks · 326 projects

MongoDBGHSA-v86x-jf74-vqfx

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

MongoDB

CVE-2026-81521 · Published Aug 27, 2026

High7.1
Fix: upgrade to 2.8.2 or later
GitHub advisory

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

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