Detect MongoDB Replication Catch-Up Use-After-Free (CVE-2026-118383) in IBM QRadar
Detects potential exploitation or exposure of CVE-2026-118383, a critical (CVSS 9.5) use-after-free (CWE-416) in the replication component of MongoDB Server. The flaw occurs when a newly elected replica set primary completes catch-up. It can be triggered by requests that do not require authentication, and may crash the server or, under certain conditions, lead to arbitrary code execution in the server process. Affected members include the shard and config server members of sharded clusters; standalone mongod instances are not affected. A public proof-of-concept reproduces the crash in a lab replica set, and Datadog Security Labs also reproduced it. Researchers did not achieve code execution, and MongoDB said it was not aware of any exploitation attempts. Affected: MongoDB 4.4.0-4.4.31, 5.0.0-5.0.34, 6.0.0-6.0.29, 7.0.0-7.0.47, 8.0.0-8.0.36, 8.3.0-8.3.15, 9.0.0-9.0.6. This detection surfaces replica set elections, primary catch-up events, unexpected mongod crashes/restarts with invariant or fault signals correlated to election activity, and version-fingerprinting that identifies vulnerable builds.
MITRE ATT&CK
- Tactic
- Impact Initial Access
QRadar Detection Query
-- df00tech DF00-5168abf96c · https://df00tech.com/detections/CVE-2026-118383 · licence: https://df00tech.com/detections/licence
SELECT QIDNAME(qid) AS event, logsourcename(logsourceid) AS host, "Message" AS payload, starttime
FROM events
WHERE LOGSOURCETYPENAME(devicetype) ILIKE '%mongo%'
AND ("Message" ILIKE '%Entering primary catch-up mode%' OR "Message" ILIKE '%transition to primary%' OR "Message" ILIKE '%election succeeded%'
OR "Message" ILIKE '%Invariant failure%' OR "Message" ILIKE '%Fatal assertion%' OR "Message" ILIKE '%SIGSEGV%' OR "Message" ILIKE '%shutting down with code%')
ORDER BY starttime DESC LAST 1 HOURS Surfaces MongoDB election/catch-up and crash log messages for correlation; pair with a QRadar pulse/rule to require both within 10 minutes per host.
Data Sources
Required Tables
False Positives & Tuning
- Planned elections during maintenance
- Crashes from unrelated causes near elections
- Election churn on unstable clusters
Other platforms for CVE-2026-118383
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Fingerprint MongoDB version for vulnerable build
Expected signal: A mongod connection log entry and the returned version string; version is compared against vulnerable ranges.
- Test 2 Induce replica set election and catch-up (lab)
Expected signal: mongod logs on members show 'Starting an election', 'election succeeded', 'transition to primary', and 'Entering/Exited primary catch-up mode'.
- Test 3 Simulate mongod crash during catch-up window (lab)
Expected signal: Service manager records a SIGSEGV (signal 11) termination of mongod; journald/syslog shows the crash near the election entries.
Response Playbook
Triage
- Confirm the affected mongod version via `db.version()` or the startup log banner and compare against the vulnerable ranges (4.4<4.4.32, 5.0<5.0.35, 6.0<6.0.30, 7.0<7.0.48, 8.0<8.0.37, 8.3<8.3.16, 9.0<9.0.7).
- Review the mongod log around the crash for `Invariant failure`, `Fatal assertion`, or `SIGSEGV` immediately following `Entering primary catch-up mode` / `transition to primary` entries.
- Determine whether the crash coincided with a replica set election by inspecting `rs.status()` election history and the oplog optime at time of failure.
- Check whether the replica set is network-exposed (bound to non-localhost, no firewall/VPC restriction) which increases reachability of the replication path.
Containment
- Restrict network access to replica set member ports (default 27017) to only trusted intra-cluster hosts via firewall/security groups.
- Prioritize a rolling upgrade to a patched MongoDB build (e.g. 7.0.48+, 8.0.37+, 9.0.7+) across all members, upgrading secondaries first then stepping down the primary.
- If a member is crash-looping during catch-up, temporarily freeze it (`rs.freeze()`) or remove it from the set to stabilize elections while patching.
Evidence Collection
- Preserve full mongod log files (including diagnostic.data FTDC directory) from any member that crashed during catch-up.
- Capture core dumps if enabled, along with `rs.status()`, `rs.conf()`, and oplog state at the time of the incident.
Escalation Criteria
- !Repeated crashes of newly elected primaries during catch-up on vulnerable versions, escalate as probable exploitation / active instability.
- !Any evidence of memory corruption beyond a clean crash (e.g. data inconsistency, unexpected privilege or auth anomalies), escalate to IR and vendor support immediately.
Investigation Guide
Forensic Artifacts
- >
mongod log entries pairing primary catch-up/election lines with invariant/SIGSEGV termination - >
FTDC diagnostic.data metrics showing the crash window - >
Core dumps of the mongod process and the exit code/signal recorded by the service manager (systemd journal)
Tuning Guidance
Baseline normal election frequency for each replica set; healthy clusters elect rarely, so tune the correlation window and crash-threshold to your environment. Exclude known maintenance windows and planned stepDown operations by annotation or time-based suppression. A public proof-of-concept exists but no in-the-wild exploitation is known, so prioritize version-fingerprinting of members to confirm exposure rather than relying solely on crash correlation, which can be noisy on unstable networks.
Hunting Queries
Finds hosts with repeated mongod crashes within an hour, a signature of catch-up crash-loop behavior on vulnerable members.
// df00tech DF00-5168abf96c · https://df00tech.com/detections/CVE-2026-118383 · licence: https://df00tech.com/detections/licence
Syslog | where ProcessName =~ "mongod" | where SyslogMessage has_any ("Invariant failure","Fatal assertion","SIGSEGV","shutting down with code") | summarize crashes=count() by Computer, bin(TimeGenerated, 1h) | where crashes > 1 ``` df00tech DF00-5168abf96c · https://df00tech.com/detections/CVE-2026-118383 · licence: https://df00tech.com/detections/licence ```
index=* sourcetype=mongodb ("Invariant failure" OR "Fatal assertion" OR "SIGSEGV" OR "shutting down with code") | bucket _time span=1h | stats count as crashes by host, _time | where crashes>1 Atomic Red Team Tests
Query a MongoDB instance for its version to determine whether it falls within the affected ranges for CVE-2026-118383.
Command
mongosh --quiet --eval 'print(db.version())' 2>/dev/null || mongo --quiet --eval 'print(db.version())' Cleanup
echo 'no cleanup required (read-only version query)' Expected Telemetry
A mongod connection log entry and the returned version string; version is compared against vulnerable ranges.
Expected Detection
Not a crash detection; feeds the version-fingerprint hunting path to confirm exposure.
Force a replica set election by stepping down the current primary in a lab cluster, generating legitimate catch-up log events for detection validation.
Command
mongosh --quiet --eval 'rs.stepDown(60)' ; sleep 5 ; mongosh --quiet --eval 'rs.status().members.forEach(m=>print(m.name,m.stateStr))' Cleanup
mongosh --quiet --eval 'rs.freeze(0)' # unfreeze any frozen member Expected Telemetry
mongod logs on members show 'Starting an election', 'election succeeded', 'transition to primary', and 'Entering/Exited primary catch-up mode'.
Expected Detection
The election/catch-up half of the correlation fires; without a coincident crash it should remain benign (tuning validation).
In an isolated lab, send SIGSEGV to a mongod process shortly after an election to emulate the use-after-free crash signature for detection testing. Do not run against production.
Command
mongosh --quiet --eval 'rs.stepDown(60)' ; sleep 3 ; PID=$(pgrep -n mongod) ; kill -SIGSEGV "$PID" Cleanup
sudo systemctl start mongod 2>/dev/null || mongod --config /etc/mongod.conf --fork Expected Telemetry
Service manager records a SIGSEGV (signal 11) termination of mongod; journald/syslog shows the crash near the election entries.
Expected Detection
The election+crash correlation rule fires because an election event and a crash event co-occur on the same host within the window.