MongoDB Server flaw CVE-2026-118383 crashes replica set members during failover
TL;DR
MongoDB Server is vulnerable to a critical use-after-free flaw, CVE-2026-118383, which can crash replica set members during a failover. Unauthenticated attackers can trigger this crash by poisoning the replication catch-up process. Upgrade all replica set members to fixed versions immediately.
What happened
A critical use-after-free vulnerability exists in the replication component of MongoDB Server. The flaw is triggered when a newly elected replica set primary completes its catch-up phase after receiving two specific, unauthenticated ping commands containing a readConcern.afterOpTime value. These requests create a "waiter" that remains in the system until the member restarts or steps down.
When the member later wins an election and attempts to catch up, the cleanup process runs twice, causing the server to use memory that has already been freed. This results in a crash, such as a segmentation fault, or potentially arbitrary code execution. While MongoDB has released fixed versions, researchers noted that the 8.2 branch may still be vulnerable even at its latest release, 8.2.12, as it requires a specific backport.
Why it matters
This is a high-impact flaw because the trigger requires no authentication. While an attacker cannot force a server to fall behind or win an election, they can wait for a natural failover to strike. If the targeted member is elected primary, the subsequent crash leaves the cluster without a primary, disrupting database availability. For those running sharded clusters, this affects both shard and config server members.
Who is affected
- MongoDB Server 8.0.x (versions before 8.0.37)
- MongoDB Server 8.2 builds (including 8.2.12, which may still exhibit the bug)
- Shard and config server replica set members of sharded clusters
Note: Standalone mongod instances are not affected.
What to do now
- Upgrade all replica set members to version 8.0.37 or higher.
- Apply fixed releases to other active branches, including 7.0.48, 8.3.16, and 9.0.7.
- Restrict network access to the database to only trusted systems to limit unauthenticated request exposure.
- Search structured logs for
COMMAND "Slow query"entries (ID 51803) containingreadConcern.afterOpTimeandMaxTimeMSExpired. - Monitor for fatal signals or backtraces involving
CatchupState::abort_inlock().
What we don't know yet
- The exact frequency of successful exploitation in real-world environments.
- Whether the reported arbitrary code execution can be reliably achieved outside of lab settings.
Sources
- thehackernews.comhttps://thehackernews.com/2026/11/critical-pre-auth-mongodb-flaw-cve-2026.html
- jira.mongodb.orghttps://jira.mongodb.org/browse/SERVER-138119
- jira.mongodb.orghttps://jira.mongodb.org/browse/SERVER-138175
- github.comhttps://github.com/googlesky/CVE-2026-118383
- blogger.googleusercontent.comhttps://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6RJLDSM13MwenwxG4xnZ-Td2_zmnya-Y39FLHlNk-7P3hZ5w1qGjG3XFqT-4gaeZIxSepWWNM53bKTIkZBNA-X_tVKsrgWbw8u81mjLzL6dXvTtvKfKeT-FkwSz4CsdMoHNza2NRFy0PJzzmaMROCr3D7e6AKT5UR3Lh4zFb_1w9HMmXXKKvATVWHU-E/s1700-nu-rw-lo-l85-e365/mongo-poc.gif
- cve.orghttps://www.cve.org/CVERecord?id=CVE-2026-118383
