CVE-2021-20329 Specific cstrings input may not be properly validated in the Go Driver

Medium 6.8 Published Updated

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.

Weakness: CWE-20, CWE-1287

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.

PackageAffectedFixed in
go.mongodb.org/mongo-driver GoAll versions1.5.1
go.mongodb.org/mongo-driver GoAll versions1.5.1
go.mongodb.org/mongo-driver GoAll versions1.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.

Sources

Also known as GHSA-f6mq-5m25-4r72, GO-2021-0112.

Is CVE-2021-20329 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free