CVE-2024-8305
Medium · 6.5CVSS
6.5
EPSS
0.6%
Published
Oct 21, 2024
CISA due date
—
Cloudanix analysis
A bug in database software can make backup copies fail and leave the main database unreachable until the issue is corrected.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- Application
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
A flaw in prepareUnique index constraint enforcement on replica set secondaries allows crafted operations to trigger crashes, and in extreme cases multiple secondaries may fail leaving no primary.
Why it matters to the business
Replica set availability can be lost, causing application downtime and requiring manual intervention to restore a primary node.
How an attack unfolds
An attacker with write access identifies a collection using prepareUnique indexes and issues targeted write operations that expose the incorrect secondary constraint handling, resulting in secondary crashes that can cascade to loss of a primary.
How to fix it
Upgrade MongoDB Server to 6.0.17 or later, 7.0.13 or later, or 7.3.4 or later; the fix is present in commit a2a46542e8d79a8b4937ed51e84dc918caf26783.
How to confirm the fix worked
Confirm the running MongoDB version meets or exceeds the listed fixed releases and inspect replica set status and logs for absence of prepareUnique-related secondary crashes.
Typical attack path
- Locate a MongoDB collection configured with a prepareUnique index
- Issue write operations that trigger secondary-specific index constraint checks
- Cause repeated crashes on secondaries until no primary remains
How to detect it
Examine MongoDB server logs on secondaries for repeated crashes mentioning prepareUnique indexes or index constraint enforcement failures.
What your security team should do
- Apply the fixed MongoDB versions to all affected replica sets without delay
- Review replica set logs for prior secondary crashes tied to index enforcement
- Validate failover behavior in staging environments after upgrade
The record
prepareUnique index may cause secondaries to crash due to incorrect enforcement of index constraints on secondaries, where in extreme cases may cause multiple secondaries crashing leading to no primaries. This issue affects MongoDB Server v6.0 versions prior to 6.0.17, MongoDB Server v7.0 versions prior to 7.0.13 and MongoDB Server v7.3 versions prior to 7.3.4
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Bitnami | mongodb | 6.0.0 | 6.0.17 |
| Ubuntu:14.04:LTS | mongodb | 0 | No fix |
| Ubuntu:16.04:LTS | mongodb | 0 | No fix |
| Ubuntu:18.04:LTS | mongodb | 0 | No fix |
| Ubuntu:20.04:LTS | mongodb | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | mongodb | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | mongodb | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | mongodb | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | mongodb | 0 | No fix |
Related vulnerabilities
- CVE-2025-14345 A post-authentication flaw in the network two-phase commit protocol used for cross-shard… Also affects mongodb
- CVE-2025-13643 A user with access to the cluster with a limited set of privilege actions may be able to… Also affects mongodb
- CVE-2025-13644 MongoDB Server may experience an invariant failure during batched delete operations when… Also affects mongodb
- CVE-2025-13507 Inconsistent object size validation in time series processing logic may result in later… Also affects mongodb
- CVE-2025-12893 Clients may successfully perform a TLS handshake with a MongoDB server despite presenting… Also affects mongodb
- CVE-2025-12657 The KMIP response parser built into mongo binaries is overly tolerant of certain… Also affects mongodb
- CVE-2024-7553 Incorrect validation of files loaded from a local untrusted directory may allow local… Also affects mongodb
- CVE-2024-3372 Improper validation of certain metadata input may result in the server not correctly… Also affects mongodb