CVE-2026-13062 Overview
CVE-2026-13062 affects MongoDB sharded clusters running Queryable Encryption. An authenticated user with write privileges on a Queryable Encryption-enabled collection can modify internal encryption metadata fields that should be server-controlled. The attacker sends crafted write commands through the mongos router to reach the sharded collection. Successful exploitation corrupts encrypted query correctness, breaking integrity guarantees the encryption layer is expected to enforce. The issue is tracked under MongoDB bug report SERVER-127831 and maps to [CWE-441] (Unintended Proxy or Intermediary, also known as Confused Deputy).
Critical Impact
Authenticated attackers with write access can tamper with server-controlled encryption metadata, corrupting Queryable Encryption results and undermining data integrity on sharded MongoDB deployments.
Affected Products
- MongoDB Server deployments running as sharded clusters
- Collections configured with Queryable Encryption
- Client applications routing writes through mongos
Discovery Timeline
- 2026-07-22 - CVE-2026-13062 published to the National Vulnerability Database (NVD)
- 2026-07-22 - Last updated in NVD database
Technical Details for CVE-2026-13062
Vulnerability Analysis
MongoDB Queryable Encryption relies on internal metadata fields embedded in encrypted documents. These fields describe encrypted payload structure, index tokens, and safe content markers. The server treats these fields as its own control plane and expects clients to never write them directly.
On a sharded cluster, write commands pass through the mongos query router before reaching shard replica sets. The vulnerability exists because mongos does not adequately filter or validate reserved encryption metadata fields on inbound write commands. An authenticated user with write privileges on the target collection can therefore inject or overwrite these fields through normal insert or update operations.
The result is corruption of encrypted query correctness. Subsequent equality or range queries against the collection can return incorrect, incomplete, or misleading results. This breaks the integrity contract of Queryable Encryption without requiring cryptographic key access.
Root Cause
The root cause is missing enforcement of the server-controlled field boundary at the mongos router. Reserved metadata fields that should be rejected or stripped from user-supplied write commands are instead forwarded to shards. This is a confused-deputy pattern captured by [CWE-441], where the router acts on behalf of the user against internal server state.
Attack Vector
The attacker must already hold write privileges on a Queryable Encryption-enabled collection. The vector is network-based through the standard MongoDB wire protocol against mongos. The attacker crafts an insert, update, or findAndModify command that includes reserved internal encryption metadata fields inside document payloads. When the router forwards the command, the shard persists the attacker-controlled metadata alongside legitimate encrypted content. Queryable Encryption index state diverges from the actual document contents, and query correctness degrades.
No public proof-of-concept is available. Technical detail is tracked in the MongoDB Bug Report SERVER-127831.
Detection Methods for CVE-2026-13062
Indicators of Compromise
- Write commands from application accounts that reference internal Queryable Encryption metadata field names inside document bodies.
- Unexpected divergence between document counts returned by encrypted equality queries and equivalent unencrypted administrative counts.
- Audit log entries showing writes to Queryable Encryption collections from principals or client drivers that do not normally handle encrypted payload construction.
Detection Strategies
- Enable MongoDB auditing on mongos and shard nodes and alert on write operations to Queryable Encryption-enabled collections that carry reserved metadata field names.
- Baseline the schema of documents produced by sanctioned MongoDB client drivers, then flag inserts and updates whose top-level or nested fields deviate from that baseline.
- Correlate application identity, source IP, and driver version on writes to encrypted collections to isolate hand-crafted commands from legitimate driver traffic.
Monitoring Recommendations
- Forward MongoDB audit and mongos command logs to a centralized analytics platform and retain them for at least 90 days.
- Track query result stability over time on Queryable Encryption collections and investigate sudden drops in expected match counts.
- Monitor privileged role assignments so that write access to encrypted collections stays limited to service accounts under change control.
How to Mitigate CVE-2026-13062
Immediate Actions Required
- Inventory all sharded MongoDB clusters and identify collections configured with Queryable Encryption.
- Restrict write privileges on those collections to service accounts used only by vetted application drivers.
- Apply the MongoDB security update referenced in SERVER-127831 as soon as the vendor patch is available for your server branch.
Patch Information
MongoDB tracks the fix under SERVER-127831. Consult that ticket for the specific server versions that include the corrected mongos field-filtering logic and schedule an upgrade on all mongos routers and shard members. No CPE list has been published in NVD at time of writing, so verify affected versions against vendor release notes.
Workarounds
- Remove write privileges on Queryable Encryption collections from any user or role that does not require them, following the principle of least privilege.
- Enforce network segmentation so only application tiers using approved MongoDB drivers can reach mongos endpoints.
- Reject client connections from unexpected driver versions or ad-hoc administrative tools using MongoDB appName filtering and firewall rules.
# Revoke broad write access and grant only the narrow role required by the application
mongosh --host mongos.example.internal <<'EOF'
use admin
db.revokeRolesFromUser("app_user", [ { role: "readWrite", db: "payments" } ])
db.grantRolesToUser("app_user", [ { role: "qeAppRole", db: "payments" } ])
EOF
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

