CVE-2025-6706

5.0 MEDIUM

📋 TL;DR

An authenticated MongoDB user can trigger a use-after-free vulnerability by executing specific aggregation pipeline operations, causing server crashes even without shutdown privileges. This affects MongoDB Server versions 6.0 before 6.0.21, 7.0 before 7.0.17, and 8.0 before 8.0.4 when the SBE engine is enabled.

💻 Affected Systems

Products:
  • MongoDB Server
Versions: v6.0 before 6.0.21, v7.0 before 7.0.17, v8.0 before 8.0.4
Operating Systems: All platforms running affected MongoDB versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only vulnerable when the SBE (Slot-Based Execution) engine is enabled, which is default in affected versions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Denial of service through repeated server crashes, potentially disrupting database availability and dependent applications.

🟠

Likely Case

Accidental or intentional server crashes by authenticated users, causing temporary service disruption.

🟢

If Mitigated

Minimal impact with proper access controls limiting authenticated users and monitoring for suspicious aggregation queries.

🌐 Internet-Facing: MEDIUM - Internet-facing MongoDB instances with authenticated user access could be targeted for DoS attacks.
🏢 Internal Only: MEDIUM - Internal authenticated users could cause service disruption, though less likely than external attacks.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires authenticated access and knowledge of specific aggregation pipeline expressions. No public exploit available at disclosure.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v6.0.21, v7.0.17, v8.0.4

Vendor Advisory: https://jira.mongodb.org/browse/SERVER-106746

Restart Required: Yes

Instructions:

1. Download patched version from MongoDB website. 2. Stop MongoDB service. 3. Backup data and configuration. 4. Install patched version. 5. Restart MongoDB service. 6. Verify version and functionality.

🔧 Temporary Workarounds

Disable SBE Engine

all

Temporarily disable the Slot-Based Execution engine to mitigate vulnerability

mongod --setParameter internalQueryFrameworkControl="forceClassicEngine"

Restrict Aggregation Operations

all

Limit user permissions to prevent execution of aggregation pipeline operations

db.revokeRolesFromUser("username", [{ role: "readWrite", db: "dbname" }])

🧯 If You Can't Patch

  • Implement strict access controls to limit authenticated users who can execute aggregation operations
  • Monitor logs for unusual aggregation queries and implement rate limiting on aggregation operations

🔍 How to Verify

Check if Vulnerable:

Check MongoDB version and SBE engine status: db.runCommand({buildInfo:1}) and db.adminCommand({getParameter:1, internalQueryFrameworkControl:1})

Check Version:

db.version()

Verify Fix Applied:

Verify version is patched: db.version() should return 6.0.21, 7.0.17, or 8.0.4 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unexpected server crashes
  • Aggregation pipeline errors with specific expressions
  • Authentication logs showing users executing aggregation operations

Network Indicators:

  • Increased failed connection attempts after crashes
  • Unusual aggregation query patterns

SIEM Query:

source="mongodb.log" AND ("aggregation" OR "pipeline") AND ("error" OR "crash" OR "exception")

🔗 References

📤 Share & Export