---
title: "MongoDB Replica Set Check (CVE-2026-118383)"
canonical: https://trickest.com/library/mongodb-replica-set-check-cve-2026-118383
description: "One standard unauthenticated MongoDB handshake per host classifies replica-set exposure for the CVE-2026-118383 catch-up use-after-free, race never triggered."
---

# MongoDB Replica Set Check (CVE-2026-118383)

## Overview

This workflow classifies MongoDB deployments for CVE-2026-118383, the use-after-free in the replication catch-up phase that can crash a newly elected primary and, under some conditions, run code in the server process. NVD scores it 10.0; MongoDB's own scores are 9.0 and 9.5. The reachability precondition is specific: replica set members only, standalone servers are not affected, and the race lives in requests a client can make. Triggering the race crashes primaries, so this workflow sends nothing beyond the standard handshake every MongoDB driver sends. Field context makes the scope clear: about 139,852 MongoDB services answer on 27017 across the family's sensor data, which is context for prioritization, not a finding. Each host comes back with a verdict you can feed into [exposure management](/use-cases/exposure-management).

## Pipeline

1. Read the target list and make one TCP connect per host, then send exactly one unauthenticated OP_MSG hello handshake: the ordinary connection-establishment frame every driver sends, which works even on secured deployments.
2. The outgoing frame is a single validated constant whose body can carry only the hello and $db keys. The race-triggering reads, election-forcing commands, authentication attempts, and malformed frames are refused by construction, and no second command is ever sent on a connection.
3. Classify topology from the answer: a setName with hosts and a primary means a replica-set member, the affected deployment class; the implicit-standalone marker means standalone, not affected by this bug; anything else stays topology unknown.
4. Map the handshake's wire version to the server train, never the patch level; exact patch versions come only from owner inventory, and patch level is always a verify-out-of-band field.
5. Reconcile one verdict per target and write findings plus summary counts. Exposure only, never vulnerable: the vendor scores the race conditions as high-complexity.

## Inputs

- **Target list.** MongoDB host addresses, with optional ports, that you are authorized to test. The default file ships a sample host; bind your own.
- **Inventory file.** Optional. Host-to-version rows from your asset system; the exact server version decides which of the seven fixed releases applies.

## Outputs

- **findings.jsonl.** One row per host: target, the handshake result, the topology classification, the wire version and its train, the inventory version where present, verdict, and severity.
- **summary.jsonl.** One line with the total, verdict counts, and the seven fixed releases named.

## Integrations

- MongoDB wire protocol. One TCP connect and one validated hello frame per host, nothing else on the connection.

## Sample output

The records below are illustrative and do not come from a real run. They show a replica-set member, a standalone server, and a host whose topology stays unknown.

```jsonl
{"target": "mongo-a.example.com", "port": 27017, "handshake": "hello_ok", "topology": "replica_set_member", "set_name": "rs0", "wire_version": 21, "train": "7.0", "inventory_version": "7.0.40", "verdict": "replica_set_exposed", "detail": "replica-set member; verify the patch level against the 7.0.48 fix out of band", "error": null}
{"target": "mongo-b.example.org", "port": 27017, "handshake": "hello_ok", "topology": "standalone", "set_name": null, "wire_version": 25, "train": "8.0", "inventory_version": null, "verdict": "not_product", "detail": "standalone server, not affected by the replication race", "error": null}
{"target": "mongo-c.example.net", "port": 27017, "handshake": "hello_ok", "topology": "unknown", "set_name": null, "wire_version": 17, "train": "6.0", "inventory_version": null, "verdict": "mongodb_topology_unknown", "detail": "mongod answered but neither replica-set nor standalone marker present", "error": null}
```

```json
{"cve": "CVE-2026-118383", "product": "MongoDB Server replica sets", "total_targets": 3, "verdict_counts": {"replica_set_exposed": 1, "not_product": 1, "mongodb_topology_unknown": 1}, "fixed_releases": ["9.0.7", "8.3.16", "8.0.37", "7.0.48", "6.0.30", "5.0.35", "4.4.32"], "field_context": "about 139,852 MongoDB services observed on 27017, context only"}
```

## FAQ

### Why classify topology instead of testing the bug?

The race fires on requests a client can make, and a successful trigger crashes the primary. There is no safe version of that test from outside, so the workflow sends only the handshake every driver sends and sorts hosts by deployment class and version instead.

### Does this affect standalone MongoDB servers?

No. The use-after-free lives in the replication catch-up path of a newly elected primary, so replica set members, including shard and config-server members of sharded clusters, are the affected class. Standalone servers come back as not affected by this bug.

### Which versions are affected?

Seven trains carry the fix: 9.0.7, 8.3.16, 8.0.37, 7.0.48, 6.0.30, 5.0.35, and 4.4.32, or later. The handshake maps to the train but not the patch, so the exact build comparison needs your inventory or a host-side check.

### What is CVE-2026-118383?

A use-after-free in the catch-up phase of a newly elected MongoDB primary, reachable through unauthenticated client requests. Not on CISA KEV and no confirmed exploitation; CISA's coordinator scored exploitation as none.

## Related workflows

- [Node.js Brotli Exposure Check (CVE-2026-111497)](/library/nodejs-brotli-exposure-check-cve-2026-111497). Reach for it when the next memory-corruption exposure question is a runtime library instead of a database engine.
- [Babelfish TDS Exposure (CVE-2026-119923)](/library/babelfish-tds-exposure-check-cve-2026-119923). Reach for it when the next database flag speaks a foreign wire protocol.
- [Full Network Port and Service Assessment](/library/full-network-port-and-service-assessment). Map which hosts answer on 27017 across the estate first.

---
_Markdown source of https://trickest.com/library/mongodb-replica-set-check-cve-2026-118383._
