Heap-based Buffer OverflowWeakness · CWE-122

CVE-2024-6383

MEDIUM · 5.3 CVSS v3.1 Published 2024-07-03
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
62/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
The bson_string_append function in MongoDB C Driver may be vulnerable to a buffer overflow where the function might attempt to allocate too small of buffer and may lead to memory corruption of neighbouring heap memory. This issue affects libbson versions prior to 1.27.1

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The bson_string_append function in libbson (MongoDB C Driver) contains a buffer allocation bug where it calculates and allocates a buffer smaller than required for string append operations. This causes a heap-based buffer overflow, corrupting adjacent memory and potentially leading to crashes or undefined behavior. The vulnerability affects all versions prior to 1.27.1.

MitigationUpgrade libbson to version 1.27.1 or later to obtain the patched version. If immediate upgrading is not feasible, audit all call sites to bson_string_append and implement bounds checking on input sizes as a temporary mitigation until the library can be updated.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Locate the installed libbson library
    Search for libbson shared objects (.so on Linux, .dll on Windows, .dylib on macOS) or static libraries in common paths such as /usr/lib, /usr/local/lib, or within the application's dependencies. Also check for bson.h header file which accompanies libbson.
    Affected if libbson library files are found on the system or within an application's dependency tree
  2. Identify the libbson version
    Run 'pkg-config --modversion libbson' if available, or check the library filename which may contain the version (e.g., libbson-1.0.so), or inspect the bson.h header for a BSON_VERSION or similar version macro, or use 'strings' on the library binary to search for version strings like '1.27' or '1.2'
    Affected if The version number returned is lower than 1.27.1, or no version string is found (indicating an older unversioned release)
  3. Verify the application links against libbson
    For a deployed application, run 'ldd <application_binary>' on Linux or 'otool -L <application_binary>' on macOS to list linked libraries and confirm libbson is dynamically linked, or check build artifacts and dependency manifests for libbson references.
    Affected if The application or service depends on a vulnerable version of libbson (version prior to 1.27.1)
  4. Confirm usage of bson_string_append
    If source code is available, search for calls to bson_string_append, bson_string_new, or related bson string construction functions. In binary analysis, use 'nm' or 'objdump' to check if the application links against bson_string_append symbol.
    Affected if The codebase or binary invokes the vulnerable bson_string_append function, which triggers the buffer allocation flaw

The environment is affected if libbson version 1.27.1 or later is not in use, and the application or library code makes use of the bson_string_append function from that vulnerable libbson version.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade libbson to version 1.27.1 or later to obtain the patched version. If immediate upgrading is not feasible, audit all call sites to bson_string_append and implement bounds checking on input sizes as a temporary mitigation until the library can be updated.

Recommended fix High confidence

libbson 1.27.1

  1. Identify the current version of libbson (libmongoc) in your environment by checking your package manager or dependencies
  2. Stop any MongoDB C Driver applications or services that are running
  3. Update libbson to version 1.27.1 or later using your package manager (e.g., apt-get update && apt-get install libbson-1.0, yum update libbson, or pip/cargo depending on your dependency management)
  4. If using a package manager that doesn't have 1.27.1 yet, download the source from the MongoDB C Driver releases page and rebuild
  5. Verify the installed version matches or exceeds 1.27.1
  6. Restart the application or service
  7. Run your test suite to verify functionality
Caveat Review MongoDB C Driver 1.27.1 release notes for any API changes or deprecations before upgrading in production

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation2.0 h
  • Testing4.0 h
  • Review / QA2.0 h
10.0 hours of engineering $1,720
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,752.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-6383 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-6383 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data