# CVE-2026-103965: MongoDB Server aggregation framework constant value handling in query rewriting

Source: https://junglewise.ai/threats/cve-2026-103965-an-issue-in-mongodb-server-s-aggregation-framework-can-cause  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-13. Updated: 2026-10-16  
License: CC BY 4.0 with a link back

CVE-2026-103965 · Severity: medium · CVSS 5.4 · Published 2026-10-13

MongoDB Server's aggregation framework, used to process and analyze data in databases, has a bug where certain constant values are incorrectly rewritten during internal query processing. An authenticated database user with read access could exploit this to receive unintended field values in query results, potentially exposing sensitive data they should not be able to see.

Technologies: [MongoDB Server](https://junglewise.ai/threats/technologies/mongodb-server). Vendors: [MongoDB](https://junglewise.ai/threats/vendors/mongodb).

## Quick answers

**Is CVE-2026-103965 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-103965 being exploited in the wild.

**How severe is CVE-2026-103965?** Medium severity, with a CVSS score of 5.4, published 13 October 2026.

**Which products and versions are affected?** MongoDB Server before 7.0.45, 8.0.34, 8.3.13, 9.0.4, 9.1.0-rc1025.

**Is there a fix for CVE-2026-103965?** Yes: fixed in 7.0.45, 8.0.34, 8.3.13, 9.0.4, 9.1.0-rc0, 9.1.0-rc1025. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-103965 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-103965?** Check whether you run MongoDB Server at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in 7.0.45, 8.0.34, 8.3.13, 9.0.4, 9.1.0-rc0, 9.1.0-rc1025

## Technical details

The $bucket aggregation stage deserializes boundary and default values by re-parsing a BSON $switch expression, causing $literal-wrapped values with dollar-prefixed strings (e.g., "$color" or "$$ROOT") to be misinterpreted as field-path or variable expressions instead of remaining constants. An authenticated user with read access can trigger this via crafted aggregation queries to extract unintended field values. The vulnerability requires authentication and specific query construction but affects the integrity of data access controls.

## Affected products

- MongoDB Server before 7.0.45, 8.0.34, 8.3.13, 9.0.4, 9.1.0-rc1025

## Timeline

- 2026-10-13: disclosed
- 2026-10-12: patched

## References

- [https://jira.mongodb.org/browse/SERVER-134618](https://jira.mongodb.org/browse/SERVER-134618)

## Related threats

- [MongoDB Server authorization bypass in aggregation pipeline](https://junglewise.ai/threats/cve-2026-120825-an-authorization-weakness-in-the-aggregation-framework-of)
- [MongoDB Server use-after-free in time-series bucket validation](https://junglewise.ai/threats/cve-2026-120824-a-use-after-free-in-the-time-series-collection-component-of)
- [MongoDB Server missing authorization check in aggregation framework](https://junglewise.ai/threats/cve-2026-120823-a-missing-authorization-check-in-the-aggregation-framework-of)
- [MongoDB Server authorization bypass in applyOps](https://junglewise.ai/threats/cve-2026-120822-mongodb-server-may-omit-an-authorization-check-on-the-resource)
- [MongoDB Server use-after-free in aggregation framework](https://junglewise.ai/threats/cve-2026-120821-a-use-after-free-in-the-aggregation-framework-of-mongodb-server)
