Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-5170 Overview
CVE-2026-5170 is a denial-of-service vulnerability affecting MongoDB Server. An authenticated user with a limited set of privilege actions can trigger a crash of a mongod process during the narrow window when a cluster is being promoted from a replica set to a sharded cluster. Successful exploitation takes down the primary of the replica set, disrupting database availability.
The issue is tracked as [CWE-617: Reachable Assertion] and is documented in MongoDB SERVER-101758. It affects MongoDB Server v8.2 prior to 8.2.2, v8.0 prior to 8.0.18, and v7.0 prior to 7.0.31.
Critical Impact
Authenticated attackers with low privileges can crash the primary mongod process during cluster promotion, causing a denial of service against MongoDB clusters.
Affected Products
- MongoDB Server v8.2 versions prior to 8.2.2
- MongoDB Server v8.0 versions prior to 8.0.18
- MongoDB Server v7.0 versions prior to 7.0.31
Discovery Timeline
- 2026-03-30 - CVE-2026-5170 published to NVD
- 2026-04-02 - Last updated in NVD database
Technical Details for CVE-2026-5170
Vulnerability Analysis
The vulnerability resides in MongoDB Server's transition logic that promotes a replica set into a sharded cluster. During this state change, the mongod process exposes a limited and unpredictable window where specific operations can reach an assertion that terminates the process. An authenticated user holding only a limited set of privilege actions can trigger this condition, killing the primary node of the replica set.
MongoDB classifies the underlying weakness as [CWE-617: Reachable Assertion]. The EPSS probability is 0.049% at the 15.214 percentile, reflecting low observed exploitation likelihood. The flaw produces an availability impact only, with no exposure of data confidentiality or integrity.
Root Cause
The root cause is insufficient state validation in the replica-set-to-sharded-cluster promotion code path. Operations that are otherwise permitted for low-privileged users are not gated against the transitional cluster state, allowing them to drive mongod into a reachable assertion. When the assertion fires, the primary process exits.
Attack Vector
Exploitation requires network access to the cluster and authenticated credentials with a limited privilege scope. The attacker must issue the triggering operation during the brief promotion window, which makes timing unpredictable but does not require complex tooling. A successful attempt terminates the primary mongod, forcing a failover or, depending on configuration, a full availability outage.
No public proof-of-concept exploit is available, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Refer to the MongoDB Issue Tracker Entry for additional technical context.
Detection Methods for CVE-2026-5170
Indicators of Compromise
- Unexpected mongod process termination on the replica set primary, particularly when log entries reference assertion failures during sharding transition operations.
- MongoDB log entries containing fassert, invariant, or replica set state transition messages correlated with cluster promotion activity.
- Repeated failover events on the primary node during or shortly after a replSetToShardedCluster promotion workflow.
Detection Strategies
- Monitor mongod audit and diagnostic logs for low-privileged user actions executed during cluster promotion windows.
- Alert on assertion or fatal-exit log lines emitted by mongod instances running affected versions (v7.0 < 7.0.31, v8.0 < 8.0.18, v8.2 < 8.2.2).
- Correlate primary step-down events with the originating authenticated session to identify the triggering principal.
Monitoring Recommendations
- Track MongoDB Server build versions across the fleet and flag hosts that remain on vulnerable releases.
- Enable MongoDB auditing for privileged commands and shard topology changes, forwarding events to your SIEM for retention and search.
- Baseline expected promotion activity and alert on operations executed by low-privilege accounts during topology changes.
How to Mitigate CVE-2026-5170
Immediate Actions Required
- Upgrade MongoDB Server to 8.2.2, 8.0.18, or 7.0.31 or later on the corresponding release branches.
- Restrict cluster access to trusted networks and enforce least-privilege role assignments for all database users.
- Plan replica-set-to-sharded-cluster promotions during maintenance windows with limited concurrent client activity.
Patch Information
MongoDB has released fixed builds in the 7.0.31, 8.0.18, and 8.2.2 series. The fix is tracked in MongoDB SERVER-101758. Upgrade affected nodes following MongoDB's standard rolling upgrade procedure to avoid additional downtime.
Workarounds
- Audit and reduce roles assigned to application users so that only required actions are granted, limiting which accounts can reach the vulnerable code path.
- Restrict who can initiate replica-set-to-sharded-cluster promotions and tightly scope the window in which the operation runs.
- Monitor primary health and configure automated failover and alerting so that any single mongod crash is detected and recovered quickly.
# Verify installed MongoDB Server version on each node
mongod --version
# Example: list users and their roles to enforce least privilege
mongosh --eval 'db.getSiblingDB("admin").system.users.find({}, {user:1, roles:1}).pretty()'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

