# CVE-2026-81521: MongoDB Go Driver namespace injection in BulkWrite

Source: https://junglewise.ai/threats/cve-2026-81521-mongodb-go-driver-namespace-injection-in-bulkwrite  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-27. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-81521 · Severity: medium · CVSS 6.5 · Published 2026-08-27

The MongoDB Go Driver's client-level bulk write operation fails to escape reserved characters (specifically "." and NUL bytes) in user-supplied database names before building the database/collection namespace. An application that accepts untrusted database names could have write operations silently redirected to unintended databases and collections, potentially causing data to be written to the wrong location or enabling unauthorized data modification.

Technologies: [MongoDB Go Driver](https://junglewise.ai/threats/technologies/go-driver). Vendors: [MongoDB](https://junglewise.ai/threats/vendors/mongodb).

## Quick answers

**Is CVE-2026-81521 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-81521 being exploited in the wild.

**How severe is CVE-2026-81521?** Medium severity, with a CVSS score of 6.5, published 27 August 2026.

**Which products and versions are affected?** MongoDB Go Driver before 2.8.2.

**Is there a fix for CVE-2026-81521?** A patch was published on 2026-08-27: Fix released in v2.8.2 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-81521 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-81521?** Check whether you run MongoDB Go Driver at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability is a namespace injection issue in the Client.BulkWrite API. When a caller supplies a database name containing reserved separator characters ("." or NUL bytes), the driver does not validate or escape these characters before constructing the target namespace. This allows an attacker-controlled database name to be reinterpreted, potentially directing writes to a different database and collection than intended. The attack vector is local/application-level—an attacker must control the database name parameter passed to the BulkWrite call. The fix (released in v2.8.2) validates database and collection names, rejecting any that contain "." or NUL bytes and returning an error to the caller, preventing silent misdirection of writes.

## Affected products

- MongoDB Go Driver before 2.8.2

## Timeline

- 2026-08-27: disclosed
- 2026-08-27: patched: Fix released in v2.8.2

## References

- [https://jira.mongodb.org/browse/GODRIVER-4075](https://jira.mongodb.org/browse/GODRIVER-4075)
- [https://pkg.go.dev/go.mongodb.org/mongo-driver/v2@v2.8.2](https://pkg.go.dev/go.mongodb.org/mongo-driver/v2@v2.8.2)

## Related threats

- [MongoDB Go Driver BSON array validation out-of-bounds](https://junglewise.ai/threats/cve-2026-107325-improper-validation-of-a-bson-array-length-in-the-mongodb-go)
- [MongoDB Go Driver integer overflow in BSON handling](https://junglewise.ai/threats/cve-2026-107324-an-integer-overflow-in-bson-value-length-handling-in-the-mongodb)
- [MongoDB Go Driver improper neutralization in GridFS delete](https://junglewise.ai/threats/cve-2026-88031-mongodb-go-driver-improper-neutralization-in-gridfs-delete)
- [MongoDB mongo-go-driver heap out-of-bounds read in GSSAPI error handling](https://junglewise.ai/threats/cve-2026-2303-mongodb-mongo-go-driver-heap-out-of-bounds-read-in-gssapi-error)
