Skip to main content
Vulnerability Database/CVE-2025-10061

CVE-2025-10061: MongoDB Server DoS Vulnerability

CVE-2025-10061 is a denial of service vulnerability in MongoDB Server caused by improper handling of $group queries with accumulator functions. Authorized users can trigger crashes repeatedly, leading to service disruption. This article covers technical details, affected versions, and mitigation strategies.

Published:

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-2025-10061 Overview

CVE-2025-10061 is a denial of service vulnerability in MongoDB Server. An authenticated user can crash the server by submitting a specially crafted $group aggregation query. The flaw stems from incorrect handling of certain accumulator functions when additional parameters are supplied within the $group operation. Repeated exploitation can cause sustained service disruption.

The vulnerability affects MongoDB Server v6.0 versions prior to 6.0.25, v7.0 versions prior to 7.0.22, v8.0 versions prior to 8.0.12, and v8.1 versions prior to 8.1.2. The issue is tracked under MongoDB SERVER-99616 and classified under [CWE-20] Improper Input Validation.

Critical Impact

An authenticated attacker with low privileges can trigger server crashes over the network, resulting in a high-impact denial of service against production MongoDB clusters.

Affected Products

  • MongoDB Server v6.0 versions prior to 6.0.25
  • MongoDB Server v7.0 versions prior to 7.0.22
  • MongoDB Server v8.0 versions prior to 8.0.12 and v8.1 versions prior to 8.1.2

Discovery Timeline

  • 2025-09-05 - CVE-2025-10061 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-10061

Vulnerability Analysis

MongoDB's aggregation pipeline supports the $group stage to combine documents by a specified expression. The stage uses accumulator functions such as $sum, $avg, $push, and $addToSet to produce aggregate values. CVE-2025-10061 arises when specific accumulator functions receive additional, unexpected parameters inside the $group operation.

The server fails to properly validate these parameters before processing them. The resulting state causes the mongod process to crash, terminating active sessions and halting query processing. An attacker holding valid database credentials with permission to run aggregation queries can issue the malformed query against any database the account can reach.

Repeated submission of the crafted query forces repeated restarts, producing a sustained denial of service against the targeted cluster. Replica set members that process the query will each crash in turn, degrading cluster availability.

Root Cause

The root cause is improper input validation [CWE-20] in the accumulator function handling path within the $group stage. The server accepts parameter structures it does not expect and fails to reject them before dispatching them to the accumulator logic.

Attack Vector

Exploitation requires network access to a MongoDB endpoint and valid authentication with permissions to run aggregation queries. The attacker sends a $group pipeline stage containing an accumulator function with additional parameters that trigger the crash. No user interaction is required. See MongoDB SERVER-99616 for vendor-provided technical details.

Detection Methods for CVE-2025-10061

Indicators of Compromise

  • Unexpected mongod process crashes or restarts correlated with incoming aggregation queries
  • MongoDB log entries showing fatal assertions or invariant failures during $group stage execution
  • Repeated client connection resets from the same authenticated user shortly before a crash event

Detection Strategies

  • Enable MongoDB audit logging and alert on aggregation queries containing $group stages with non-standard accumulator parameter structures
  • Correlate crash events in mongod.log with the preceding slow query log entries to identify the source operation and originating client
  • Monitor replica set state transitions and primary step-downs that occur without a scheduled maintenance window

Monitoring Recommendations

  • Track mongod process uptime and restart counts as a service-health signal
  • Alert on spikes in failed or aborted aggregation operations from a single authenticated principal
  • Forward MongoDB logs and audit events into a centralized SIEM for correlation with authentication activity

How to Mitigate CVE-2025-10061

Immediate Actions Required

  • Upgrade MongoDB Server to a fixed release: 6.0.25, 7.0.22, 8.0.12, or 8.1.2 or later
  • Audit database user accounts and remove aggregation privileges from accounts that do not require them
  • Review recent aggregation activity for malformed $group queries indicating prior exploitation attempts

Patch Information

MongoDB has released patched builds for all affected branches. Apply version 6.0.25, 7.0.22, 8.0.12, or 8.1.2 depending on the deployed branch. Refer to the vendor advisory at MongoDB SERVER-99616 for release details.

Workarounds

  • Restrict network access to MongoDB endpoints using firewall rules and private networking, limiting reachability to trusted application tiers
  • Enforce least-privilege role assignments so that application accounts cannot execute arbitrary aggregation pipelines against sensitive databases
  • Deploy MongoDB in a replica set configuration so that an individual node crash does not immediately translate to full service outage while patches are rolled out
bash
# Verify current MongoDB Server version
mongosh --quiet --eval "db.version()"

# Example role restriction: grant read-only access without aggregation abuse surface
mongosh admin --eval 'db.createRole({
  role: "appReadLimited",
  privileges: [
    { resource: { db: "appdb", collection: "" }, actions: [ "find" ] }
  ],
  roles: []
})'

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.