CVE-2024-6381 MongoDB C Driver bson_strfreev may be susceptible to integer overflow

Medium 4.0 Published Updated

An integer overflow in the bson_strfreev function of the MongoDB C Driver can lead to memory corruption and potential code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-6381?

CVE-2024-6381 is a medium-severity vulnerability in MongoDB Inc libbson, published on 2 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

The bson_strfreev function in the MongoDB C driver library may be susceptible to an integer overflow where the function will try to free memory at a negative offset. This may result in memory corruption. This issue affected libbson versions prior to 1.26.2

Weakness: CWE-680

Which versions are affected by CVE-2024-6381?

It affects 1 product.

Products include Mongodb Libbson.

How do I fix CVE-2024-6381?

Upgrade to a fixed version.

Is CVE-2024-6381 being exploited?

There is no known exploitation of CVE-2024-6381 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-6381, GHSA-vc2m-fm8c-xx2j, OESA-2024-1891, UBUNTU-CVE-2024-6381.

Is CVE-2024-6381 in your software?

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

Check your SBOMs for free