CVE-2024-6375 Overview
A missing authorization check vulnerability exists in MongoDB Server's shard key refinement command. When exploited, this security flaw allows the command to execute directly on a shard without proper access control validation. The consequence of this vulnerability is twofold: it can lead to degradation of query performance and may reveal chunk boundaries through timing side channels, potentially exposing sensitive information about the database's internal structure to unauthorized parties.
Critical Impact
Unauthorized execution of shard key refinement commands can degrade query performance and leak sensitive chunk boundary information through timing side channels.
Affected Products
- MongoDB Server v5.0 versions prior to 5.0.22
- MongoDB Server v6.0 versions prior to 6.0.11
- MongoDB Server v7.0 versions prior to 7.0.3
Discovery Timeline
- 2024-07-01 - CVE CVE-2024-6375 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2024-6375
Vulnerability Analysis
This vulnerability is categorized under CWE-285 (Improper Authorization) and CWE-862 (Missing Authorization), both of which relate to access control failures. The shard key refinement command in MongoDB is designed to modify the granularity of a collection's shard key, which is a critical operation in sharded cluster management.
Under normal circumstances, this command should undergo authorization checks to ensure only privileged users can execute it. However, the affected versions lack this authorization verification, creating a pathway for unauthorized command execution. The vulnerability is network-accessible and does not require user interaction or special privileges to exploit, making it particularly concerning for internet-facing MongoDB deployments.
Root Cause
The root cause of this vulnerability is a missing authorization check in the code path handling shard key refinement operations. When the refine collection shard key command is invoked, the authorization framework fails to validate whether the requesting entity has the necessary permissions to perform this operation. This oversight allows the command to bypass the intended access control mechanisms and execute directly on a shard.
Attack Vector
The attack vector for CVE-2024-6375 is network-based, meaning an attacker with network access to the MongoDB server can potentially exploit this vulnerability. The exploitation does not require authentication or user interaction.
An attacker could exploit this vulnerability by:
- Identifying a MongoDB sharded cluster running an affected version
- Crafting and sending a refine collection shard key command to the target server
- Observing the response timing to infer chunk boundaries (timing side channel attack)
- Potentially degrading query performance through repeated unauthorized operations
The timing side channel aspect of this vulnerability is particularly noteworthy as it can reveal internal database structure information that should remain confidential. For detailed technical information, refer to the MongoDB Jira Issue SERVER-79327.
Detection Methods for CVE-2024-6375
Indicators of Compromise
- Unexpected refineCollectionShardKey commands in MongoDB audit logs from unauthorized sources
- Unusual query performance degradation without corresponding workload changes
- Anomalous network traffic patterns targeting MongoDB ports (default 27017)
- Repeated failed or suspicious command executions against sharded collections
Detection Strategies
- Enable MongoDB's profiler to capture all database operations and review for unauthorized shard key refinement attempts
- Implement network monitoring to detect unusual connection patterns to MongoDB instances
- Review MongoDB server logs for unexpected administrative commands executed against sharded collections
- Deploy intrusion detection rules that flag refineCollectionShardKey operations from non-administrative sources
Monitoring Recommendations
- Configure MongoDB audit logging to capture all administrative operations including shard key modifications
- Monitor for timing anomalies in database response patterns that could indicate side channel exploitation attempts
- Set up alerts for any shard key refinement operations outside of scheduled maintenance windows
- Implement baseline monitoring for query performance to detect degradation indicative of exploitation
How to Mitigate CVE-2024-6375
Immediate Actions Required
- Upgrade MongoDB Server to patched versions: 5.0.22 or later, 6.0.11 or later, or 7.0.3 or later
- Restrict network access to MongoDB instances using firewall rules and network segmentation
- Review access controls and ensure only authorized users can connect to sharded cluster components
- Enable authentication and authorization on all MongoDB deployments if not already configured
Patch Information
MongoDB has released patches addressing this authorization bypass vulnerability. Organizations should upgrade to the following fixed versions:
- MongoDB Server v5.0: Upgrade to version 5.0.22 or later
- MongoDB Server v6.0: Upgrade to version 6.0.11 or later
- MongoDB Server v7.0: Upgrade to version 7.0.3 or later
For detailed patch information and additional guidance, refer to the MongoDB Jira Issue SERVER-79327.
Workarounds
- Implement network-level access controls to restrict connections to MongoDB shards to trusted sources only
- Enable MongoDB authentication and ensure proper role-based access control (RBAC) is configured
- Deploy MongoDB instances behind a properly configured firewall with strict ingress rules
- Use VPN or private network connections to isolate MongoDB traffic from public networks
# Configuration example - Enable authentication in mongod.conf
security:
authorization: enabled
# Network binding restriction
net:
bindIp: 127.0.0.1,<trusted_internal_ip>
port: 27017
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


