CVE-2024-6382: Mongodb MongoDB Rust Driver May Issue Vulnerability

MODERATE
Advisory Identifier: GHSA-32jf-h775-g29h
CVSS 6.4
CWE-228
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-6382
GHSA Identifier GHSA-32jf-h775-g29h
Severity MODERATE
CVSS v3.1 Base Score 6.4
CWE Classification CWE-228: Improper Handling of Syntactically Invalid Structure
Affected Product Mongodb
Package Ecosystem crates.io
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (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.

mongodb fixed: 2.8.2
Upgrade mongodb to 2.8.2
Verify Direct and Transitive Dependencies

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

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

CVE-2024-6382 Affected Mongodb Versions

1 component(s)
Fixed Versions:
2.8.2
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?
CVE-2024-6382 is a security vulnerability in Mongodb involving MongoDB Rust driver may issue unintended commands under CWE-228: Improper Handling of Syntactically Invalid Structure.
Which Mongodb versions are affected?
Affected versions include releases prior to 2.8.2 across affected packages: mongodb.
What version fixes CVE-2024-6382?
Upgrading to 2.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongodb affected?
Yes, mongodb is affected in releases prior to 2.8.2. Upgrade your dependency to 2.8.2 or later.
What is the CVSS score of CVE-2024-6382?
CVE-2024-6382 has a CVSS v3.1 base score of 6.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L.
What CWE is associated with CVE-2024-6382?
CVE-2024-6382 is classified under CWE-228: Improper Handling of Syntactically Invalid Structure (The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification.).
How can I check crates.io dependencies for CVE-2024-6382?
Run the dependency tree command: 'inspect dependencies for mongodb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}