ShieldPack SHIELD PACK
From 1401 onwards.

Where would you like to start?

Services, updates, and ways to contact us, all in one place

Pricing and orders →

Use the bot or chat with us—whichever you prefer

ShieldPack posts

Critical Pre-Auth MongoDB Flaw (CVE-2026-118383) Can Crash Lagging Servers on Failover

About 4 min read

MongoDB has disclosed a critical vulnerability, identified as CVE‑2026‑118383, that can cause a replica‑set member to crash when it later assumes the role of primary after a failover. The flaw is a use‑after‑free bug that triggers when an unauthenticated client sends two specially crafted ping commands containing a readConcern.afterOpTime value. The server records these requests as “waiters” and, during the cleanup phase that follows a catch‑up operation after an election, it reuses memory that has already been freed. The result is a segmentation fault that brings down the newly elected primary before it can accept any writes.
The issue only affects members of a replica set – the primary and its secondary peers that replicate data – as well as shard and config server members in sharded clusters. Stand‑alone mongod instances are not vulnerable. All versions in the affected branches, from the first release of each branch up to the latest pre‑patch releases, are susceptible. MongoDB released patched versions earlier this week: 8.0.37 for the 8.0 branch and equivalent updates for other branches. The company rates the vulnerability 9.5 out of 10 on the CVSS 4.0 scale and notes that it discovered the flaw internally, with no evidence of active exploitation.
Datadog Security Labs reproduced the crash in a controlled lab environment and published a technical analysis. Their experiment showed that authentication does not block the two malicious ping requests; the attacker does not need to write to the database or manipulate election outcomes. The attacker merely needs to deliver the two requests to a secondary that is lagging behind the current primary. When that secondary later wins an election, the cleanup code runs twice, reusing freed memory and causing the crash. In the lab, the researchers forced a failover by pausing and stopping mongod processes with admin privileges, while the malicious client remained unauthenticated and read‑only.
The practical impact for ShieldPack readers who run MongoDB in production is significant. A crash of the primary during a failover can leave a replica set without a writable node, potentially halting application traffic and causing data‑availability outages. In some configurations, another secondary may be elected quickly enough to keep the cluster alive, but the risk of service interruption remains. Moreover, the researchers note that under certain conditions the bug could lead to arbitrary code execution, although they did not achieve this in their tests.
MongoDB Atlas customers receive the patched binaries automatically during scheduled maintenance, according to the vendor’s security announcement. Organizations that defer maintenance are urged to apply the upgrade as soon as possible. For self‑managed deployments, every member of each replica set – including containers and any nodes that were offline during the maintenance window – must be upgraded to the fixed release. After upgrading, administrators should verify the version of each member and confirm that the new binaries are running.
Critical Pre-Auth MongoDB Flaw (CVE-2026-118383) Can Crash Lagging Servers on Failover
The 8.2 branch is not listed among the affected versions, and its latest release, 8.2.12, is technically outside the vulnerable set. However, a proof‑of‑concept posted on GitHub demonstrated that 8.2.12 still exhibited the crash in a lab test when a test‑only setting was enabled. The 8.2 branch reached end‑of‑life on July 31, meaning it no longer receives security updates. Users of that branch should consider migrating to a supported version or applying any available back‑ported fixes.
Until all members are patched, the researchers recommend restricting network access to the database to only trusted systems. Limiting which hosts can reach the MongoDB ports reduces the chance that an unauthenticated attacker can deliver the two ping requests, though it does not eliminate the underlying flaw. Administrators should also monitor structured logs for signs of the malicious waiters: entries showing ping commands with readConcern.afterOpTime, the creation of waiters, and any double‑run cleanup events. Logging details may vary; the attr.remote field might display a loopback address if the request originated locally.
The fix addresses two aspects of the vulnerability. First, it restricts the use of readConcern.afterOpTime to system users, causing the server to reject the crafted ping commands as unauthorized. Second, it prevents the cleanup routine from executing twice when waiters are already present, eliminating the use‑after‑free condition. In the patched 8.0.37 release, the server rejects both malicious requests outright and the member remains stable during and after failover.
In summary, the CVE‑2026‑118383 flaw poses a serious risk to any MongoDB deployment that relies on replica sets or sharded clusters. The attack vector is simple, requires no authentication, and can lead to a primary crash during a failover, potentially disrupting services. MongoDB has issued patches for all affected branches, and Atlas users receive them automatically. Self‑hosted environments must upgrade every replica‑set member promptly, enforce strict network controls, and monitor logs for the characteristic wait‑er and cleanup patterns. Failure to act could result in unexpected downtime or, in worst‑case scenarios, memory corruption that might be leveraged for code execution.

Source: The Hacker News · Cybersecurity

ShieldPack media