# GO-2021-0111 - Due to improper input sanitization when marshalling Go objects into BSON, a maliciously constructed Go…

Source: https://junglewise.ai/threats/go-2021-0111-due-to-improper-input-sanitization-when-marshalling-go-8c92c5e4  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-07-28  
License: CC BY 4.0 with a link back

Severity: info · Published 2021-07-28

Due to improper input sanitization when marshalling Go objects into BSON, a maliciously constructed
Go structure could allow an attacker to inject additional fields into a MongoDB document. Users are
affected if they use this package to handle untrusted user input.

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

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 28 July 2021.

**Which products and versions are affected?** go.mongodb.org/mongo-driver (Go) SEMVER:introduced=0,fixed=1.5.1.

**Is there a fix for This vulnerability?** Yes. go.mongodb.org/mongo-driver (Go): upgrade to 1.5.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected?** Check whether you run go.mongodb.org/mongo-driver (Go) 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.

## How to fix

- go.mongodb.org/mongo-driver (Go): upgrade to 1.5.1 or later

  ```sh
  go get go.mongodb.org/mongo-driver@v1.5.1
  ```


## Affected products

- go.mongodb.org/mongo-driver (Go) SEMVER:introduced=0,fixed=1.5.1

## Related threats

- [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)
- [GO-2021-0112 - Improper input validation in go.mongodb.org/mongo-driver](https://junglewise.ai/threats/cve-2021-20329-go-mongodb-org-mongo-driver-improperly-validates-cstrings-when)
