CVE-2024-6383
Medium · 5.3CVSS
5.3
EPSS
0.6%
Published
Jul 3, 2024
CISA due date
—
Cloudanix analysis
A memory-handling mistake in a common MongoDB support library can let remote attackers crash or subtly damage applications that use it.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The bson_string_append function in libbson can miscalculate buffer size during string append operations, resulting in an undersized allocation that corrupts adjacent heap memory.
Why it matters to the business
Applications built with affected libbson versions may experience unexpected crashes, data corruption, or degraded service availability when processing certain BSON inputs over the network.
How an attack unfolds
An attacker sends a crafted BSON document containing a string that triggers the miscalculation in bson_string_append; the resulting heap corruption can be leveraged to alter control data or cause denial of service without requiring authentication.
How to fix it
Upgrade all consumers of libbson to version 1.27.1 or later; rebuild and redeploy dependent applications after the library update.
How to confirm the fix worked
Confirm the running libbson shared object or static archive reports version 1.27.1 or higher; exercise BSON string append paths with boundary-case inputs in a test harness to verify absence of crashes or corruption.
Typical attack path
- Identify a network-accessible service that links against a vulnerable libbson version
- Craft and transmit a BSON payload designed to exercise the bson_string_append path with an oversized or specially formatted string
- Trigger the undersized allocation and subsequent heap write
- Observe process crash or attempt to chain corruption into further exploitation primitives
How to detect it
Review application and library logs for unexpected process terminations or heap-related error messages near BSON parsing code; correlate with inbound network traffic containing BSON documents.
What your security team should do
- Inventory all builds and containers that statically or dynamically link libbson and schedule upgrades to 1.27.1+
- Add dependency scanning rules that block builds using libbson < 1.27.1
- Monitor EPSS and exploit maturity signals for any future increase in observed activity
The record
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
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | libbson-xs-perl | 0 | 0.8.4-1+deb11u1 |
| Debian:11 | mongo-c-driver | 0 | No fix |
| Debian:12 | libbson-xs-perl | 0 | No fix |
| Debian:12 | mongo-c-driver | 0 | No fix |
| Debian:13 | mongo-c-driver | 0 | 1.27.1-1 |
| Ubuntu:20.04:LTS | mongo-c-driver | 0 | No fix |
| Ubuntu:22.04:LTS | mongo-c-driver | 0 | No fix |
| Ubuntu:24.04:LTS | mongo-c-driver | 0 | No fix |
| Ubuntu:24.10 | mongo-c-driver | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | libbson | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | libbson | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | mongo-c-driver | 0 | No fix |
| Ubuntu:Pro:24.04:LTS | mongo-c-driver | 0 | 1.26.0-1.1ubuntu2+esm1 |
Related vulnerabilities
- CVE-2024-6381 The bson_strfreev function in the MongoDB C driver library may be susceptible to an… Also affects libbson-xs-perl
- CVE-2017-14227 In MongoDB libbson 1.7.0, the bson_iter_codewscope function in bson-iter.c miscalculates… Also affects libbson-xs-perl
- CVE-2024-7553 Incorrect validation of files loaded from a local untrusted directory may allow local… Also affects mongo-c-driver
- CVE-2026-112403 Pillow is a Python imaging library. CWE-122
- CVE-2026-112393 Pillow is a Python imaging library. CWE-122
- CVE-2026-112395 Pillow is a Python imaging library. CWE-122
- CVE-2026-103658 GNU Aspell 0.60.8.2 (first vulnerable version is not known) contains a heap-based buffer… CWE-122
- CVE-2026-107161 A heap-based buffer overflow flaw was found in Cyrus SASL. CWE-122