CVE-2021-20329 Specific cstrings input may not be properly validated in the Go Driver
A malicious user can inject additional fields into BSON documents by exploiting improper cstring validation in the MongoDB Go Driver.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-20329?
CVE-2021-20329 is a medium-severity vulnerability in MongoDB Go Driver, published on 10 Jun 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
Specific cstrings input may not be properly validated in the MongoDB Go Driver when marshalling Go objects into BSON. A malicious user could use a Go object with specific string to potentially inject additional fields into marshalled documents. This issue affects all MongoDB GO Drivers prior to and including 1.5.0.
Which versions are affected by CVE-2021-20329?
3 open source packages ship an affected version, including go.mongodb.org/mongo-driver. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
go.mongodb.org/mongo-driver Go | All versions | 1.5.1 |
go.mongodb.org/mongo-driver Go | All versions | 1.5.1 |
go.mongodb.org/mongo-driver Go | All versions | 1.5.1 |
Products include Mongodb Go Driver.
How do I fix CVE-2021-20329?
Upgrade go.mongodb.org/mongo-driver to 1.5.1 or later.
Is CVE-2021-20329 being exploited?
There is no known exploitation of CVE-2021-20329 in the wild and no public exploit code.
Other vulnerabilities in MongoDB Go Driver
- CVE-2026-107324 Application denial of service via integer overflow in BSON value-length validation in MongoDB Go Driver
- CVE-2026-107325 Application denial of service via missing BSON array length validation in MongoDB Go Driver
- CVE-2026-81521 Cross-database write retargeting via unvalidated dotted database name in Client.BulkWrite in the MongoDB Go Driver
- CVE-2026-88031 GridFS data deletion via query-operator injection in file IDs in the MongoDB Go Driver
Sources
Also known as GHSA-f6mq-5m25-4r72, GO-2021-0112.