CVE-2024-6382: Mongodb MongoDB Rust Driver May Issue Vulnerability
MODERATECVE-2024-6382 is a MODERATE (CVSS 6.4) mongodb rust driver may issue vulnerability (CWE-228: Improper Handling of Syntactically Invalid Structure) affecting Mongodb libraries in the crates.io ecosystem. The issue involves mongodb rust driver may issue unintended commands. Remediation is available by upgrading affected packages to version 2.8.2.
CVE-2024-6382 at a Glance
Security Impact
CVSS: 6.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L).
How to Fix CVE-2024-6382
To remediate this vulnerability, upgrade all affected Mongodb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade mongodb to 2.8.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for mongodb
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-6382, inspect your project dependencies for Mongodb:
inspect dependencies for mongodb
Analyze the terminal output to locate any version of Mongodb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-228: Improper Handling of Syntactically Invalid Structure, where the product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification. In Mongodb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-6382 Affected Mongodb Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mongodb
|
crates.io |
≥ 2.0.0
< 2.8.2
|
2.8.2
|
References
Frequently Asked Questions
What is CVE-2024-6382?
Which Mongodb versions are affected?
What version fixes CVE-2024-6382?
Is mongodb affected?
What is the CVSS score of CVE-2024-6382?
What CWE is associated with CVE-2024-6382?
How can I check crates.io dependencies for CVE-2024-6382?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-32jf-h775-g29h",
"modified" : "2025-10-02T21:35:39Z",
"published" : "2024-07-02T21:32:16Z",
"aliases" : [ "CVE-2024-6382" ],
"summary" : "MongoDB Rust driver may issue unintended commands",
"details" : "Incorrect handling of certain string inputs may result in MongoDB Rust driver constructing unintended server commands. This may cause unexpected application behavior including data modification. This issue affects MongoDB Rust Driver 2.0 versions prior to 2.8.2",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "mongodb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.8.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-6382"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-rust-driver/pull/1045"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-rust-driver/commit/8eac3bc6dc37a6d7667ed6c1a895c224e3ff47e1"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-rust-driver/commit/a3fe6c84ce6287348b1268f651fdac9fbed66187"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mongodb/mongo-rust-driver"
}, {
"type" : "WEB",
"url" : "https://jira.mongodb.org/browse/RUST-1881"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-228" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-02T21:35:38Z",
"nvd_published_at" : "2024-07-02T18:15:04Z"
}
}