CVE-2025-14847 — MongoDB and MongoDB Server Improper Handling of Length Parameter Inconsistency Vulnerability

CVE-2025-14847

MongoDB — Unauthenticated Heap Memory Leak via Zlib Inconsistent Length Fields; Pre-Auth Confidentiality Impact

What is MongoDB?

MongoDB is one of the world's most widely deployed open-source NoSQL databases, used across enterprise and cloud-native applications for storing JSON-like documents. MongoDB supports a wire protocol that can optionally compress messages using zlib, snappy, or zstd compression. The compression layer processes client-supplied data before authentication — meaning any client, authenticated or not, can submit compressed messages that the server decompresses.

Overview

CVE-2025-14847 is an improper handling of length parameter inconsistency (CWE-130) in MongoDB's zlib-compressed wire protocol handling. When a client sends a message with deliberately inconsistent compressed/decompressed length fields, the server's decompression path uses an incorrectly sized or positioned buffer — reading uninitialized or previously freed heap memory — and may return that heap content to the client in the response. This allows an unauthenticated client to read arbitrary heap memory from the MongoDB server process without credentials.

The 10-day gap between patch and CISA KEV listing (December 19 → December 29) indicates the vulnerability was considered near-trivially exploitable or already actively exploited.

Affected Versions

Branch Vulnerable Fixed
MongoDB 4.4.x < 4.4.30 4.4.30
MongoDB 5.0.x < 5.0.32 5.0.32
MongoDB 6.0.x < 6.0.27 6.0.27
MongoDB 7.0.x < 7.0.28 7.0.28
MongoDB 8.0.x < 8.0.17 8.0.17
MongoDB 8.2.x < 8.2.3 8.2.3

Technical Details

The vulnerability (CWE-130: Improper Handling of Length Parameter Inconsistency) is in MongoDB's wire protocol decompression code for zlib-compressed messages. The zlib compressed message format includes:

  • Compressed length: the size of the compressed data
  • Uncompressed length: the expected size after decompression

When these two fields are deliberately inconsistent — for example, specifying a compressed length that doesn't match the actual compressed data size — MongoDB allocates a decompression buffer based on one length value but reads data based on another. This causes the decompression to read from an incorrect memory offset, potentially returning heap memory contents that were not part of the compressed message.

Attack scenario:

  1. Unauthenticated client connects to MongoDB port (default 27017)
  2. Client sends a zlib-compressed wire protocol message with intentionally mismatched length fields
  3. MongoDB attempts decompression using incorrect length values
  4. MongoDB returns heap memory to the client in the response body
  5. Attacker analyzes the returned data for sensitive information: connection strings, cached query results, credentials, authentication tokens

Impact: Confidentiality only (C:H, I:N, A:N) — heap memory leakage without write or code execution capability. However, heap contents can include credentials, query data, and other sensitive application information.

Discovery

Not publicly attributed beyond MongoDB's internal identification.

Exploitation Context

CISA added the vulnerability to the KEV catalog with only a 10-day delay after the patch — the fastest turnaround in the 2025-2026 period for a non-network-based service vulnerability. This reflects either confirmed active exploitation or assessment of near-certain rapid exploitation due to the trivial attack surface (unauthenticated, no complexity). MongoDB instances exposed to the internet without authentication are common in cloud deployments.

Remediation

  1. Upgrade MongoDB to the appropriate fixed version per the table above. The CISA deadline was January 19, 2026.
  2. Restrict MongoDB network access — MongoDB should never be internet-accessible without authentication; place it behind a firewall, VPN, or application server layer.
  3. Enable MongoDB authentication (--auth flag) — unauthenticated MongoDB instances are a systemic security risk beyond this specific CVE.
  4. Disable zlib compression as a temporary workaround if immediate patching is not possible: use the compressors connection string option to restrict to uncompressed connections.
  5. Rotate sensitive credentials and tokens if MongoDB was publicly accessible before patching — heap contents may have been exfiltrated.

Key Details

PropertyValue
CVE ID CVE-2025-14847
Vendor / Product MongoDB — MongoDB and MongoDB Server
NVD Published2025-12-19
NVD Last Modified2026-01-13
CVSS 3.1 Score7.5
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
SeverityHIGH
CWE CWE-130 find similar ↗
CISA KEV Added2025-12-29
CISA KEV Deadline2026-01-19
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Required Action

CISA BOD 22-01 Deadline: 2026-01-19. Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.

Timeline

DateEvent
2025-12-19CVE published; MongoDB releases fixed versions across all supported branches
2025-12-29Added to CISA Known Exploited Vulnerabilities catalog (10-day turnaround — unusually rapid)
2026-01-19CISA BOD 22-01 remediation deadline

References

ResourceType
MongoDB JIRA SERVER-115508 — CVE-2025-14847 Fix Vendor Advisory
NVD — CVE-2025-14847 Vulnerability Database
CISA KEV Catalog Entry US Government
MongoDB Release Notes Vendor Advisory