Skip to content
nulltapE-reader edition

← All e-reader articles

4 min read

MongoDB flaw crashes newly elected replica primaries

Two unauthenticated requests can leave stale waiters ahead of an election; patch replica-set members and check earlier command logs alongside catch-up crashes.

Read on the standard site

A large database server in a replica set, with an interrupted status light as it becomes primary.

Two unauthenticated requests left a MongoDB replica-set member primed to crash when it later won an election in Datadog Security Labs’ controlled tests. The critical use-after-free, CVE-2026-118383, affects replica-set members, including shard and config-server replica sets. A standalone mongod instance has no primary catch-up and falls outside the affected scope.

The crash waits for a particular event: the targeted member must become primary while behind another member. MongoDB’s CVE record also lists arbitrary code execution in the server process as a possible outcome under certain conditions. Datadog reproduced a server crash, not code execution. Investigate failed elections as possible crashes while patching against the full vendor-described impact.

Waiters survive until the election

A newly elected primary catches up on missed writes before it accepts new writes. MongoDB creates a waiter when a client asks for replication to reach an operation time. Datadog found that requests accepted before authentication could leave two such waiters on a reachable vulnerable member. They can persist while it runs normally. Later, if that member wins an election while lagging, cleanup at the end of catch-up runs twice and accesses freed memory. In Datadog’s vulnerable run, the member crashed before taking writes.

The attacker needs access to the MongoDB listener to submit the unauthenticated requests. The lag and election must occur later; the research team created those conditions with administrator access in its lab. Its roughly 40-second lab run measures that controlled test, rather than a time an outside attacker can count on. After the crash its test cluster had no primary; a different replica set might elect another member. MongoDB says it discovered the issue internally and was unaware of exploitation attempts when it announced the update on November 10, according to Datadog.

Three runs isolate the crash

Datadog compared three failovers in a four-member replica set. On 8.0.34, the two unauthenticated requests timed out with MaxTimeMSExpired, then the member exited catch-up twice and logged SIGSEGV. On 8.0.34 without those requests, it exited catch-up once and became writable. On fixed 8.0.37, the requests were rejected with Unauthorized; the elected member exited catch-up once and stayed running during the observation window. Datadog quotes the crash log: “Got signal: 11 (Segmentation fault).” Its backtrace included CatchupState::abort_inlock().

Those runs separate a stale-waiter setup from ordinary failover. Datadog’s patched run tested rejection of new requests; MongoDB’s regression tests also cover the cleanup path when waiters already exist. Authentication alone leaves the described pre-login request path reachable on a vulnerable server. The NVD record carries MongoDB’s affected-branch ranges and its 9.5 CVSS v4.0 score; the score describes severity, while the election dependency controls when this particular crash can fire.

Earlier command logs matter

For recognition, search each member’s structured server logs before an election for COMMAND “Slow query” events with ID 51803. In Datadog’s run, the command included attr.command.ping, attr.command.readConcern.afterOpTime, and attr.command.maxTimeMS; the expired wait appeared as attr.errName = MaxTimeMSExpired. Keep attr.durationMillis and attr.remote with the event. Correlate a later entry into primary catch-up, ID 21359, two exits from catch-up, ID 21363, in the same transition, and a fatal signal or backtrace naming CatchupState::abort_inlock(). A single catch-up exit is part of a normal election.

Check the logging path before treating an empty search as reassuring. MongoDB records client operations in the diagnostic log when they exceed the slow-operation threshold or command verbosity is at least one; sampling and log pipelines can discard the command object. attr.remote can show a loopback peer rather than the original client. Preserve earlier logs from the affected member when triaging a failed election. Datadog reports that its Cloud SIEM detection for this CVE was being evaluated at publication, so use server logs and your own retained telemetry for this check.

Patch members and confirm versions

Inventory the running version of each replica-set member, including shard and config-server members, containers, and nodes that were offline during maintenance. The first fixed releases are 9.0.7 for 9.0, 8.3.16 for 8.3, 8.0.37 for 8.0, 7.0.48 for 7.0, 6.0.30 for 6.0, 5.0.35 for 5.0, and 4.4.32 for 4.4. Upgrade every affected member to its fixed branch release or a distributor build containing the fix. MongoDB says Atlas clusters receive upgrades automatically during maintenance; confirm the running version if that maintenance was deferred.

Restrict MongoDB listener access to systems that need it while upgrades roll out. This reduces who can reach the pre-authentication request path, but patching fixes the use-after-free. After the upgrade, compare the running build on every member with its branch’s fixed release. The expected result is that every affected replica-set member runs a fixed build; investigate any earlier paired wait events and duplicate catch-up exits as a separate incident question rather than using a successful upgrade as a substitute for log review.

Primary sources