CVE-2025-14847

7.5 HIGH CISA KEV

📋 TL;DR

This vulnerability allows unauthenticated clients to read uninitialized heap memory from MongoDB servers by exploiting mismatched length fields in Zlib compressed protocol headers. This could leak sensitive information like credentials, session tokens, or database contents. All MongoDB Server versions from 3.6 through 8.2 are affected unless patched.

💻 Affected Systems

Products:
  • MongoDB Server
Versions: v3.6.0 to v3.6.x (all), v4.0.0 to v4.0.x (all), v4.2.0 to v4.2.x (all), v4.4.0 to v4.4.29, v5.0.0 to v5.0.31, v6.0.0 to v6.0.26, v7.0.0 to v7.0.27, v8.0.0 to v8.0.16, v8.2.0 to v8.2.2
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All configurations using affected versions are vulnerable if the MongoDB server is accessible to unauthenticated clients.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could extract sensitive data including authentication credentials, encryption keys, or database contents, potentially leading to full system compromise.

🟠

Likely Case

Information disclosure of heap memory contents, which may include fragments of sensitive data, though structured extraction is difficult.

🟢

If Mitigated

Minimal impact if proper network segmentation and authentication controls prevent unauthenticated access to MongoDB ports.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires network access to MongoDB port (default 27017) and knowledge of the vulnerability. Public proof-of-concept code exists.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v3.6.x (latest), v4.0.x (latest), v4.2.x (latest), v4.4.30, v5.0.32, v6.0.27, v7.0.28, v8.0.17, v8.2.3

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

Restart Required: Yes

Instructions:

1. Identify current MongoDB version. 2. Download appropriate patched version from MongoDB website. 3. Stop MongoDB service. 4. Install patched version. 5. Restart MongoDB service. 6. Verify version is updated.

🔧 Temporary Workarounds

Network Access Restriction

linux

Restrict network access to MongoDB ports to only trusted IP addresses using firewall rules.

sudo ufw allow from TRUSTED_IP to any port 27017
sudo iptables -A INPUT -p tcp --dport 27017 -s TRUSTED_IP -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 27017 -j DROP

Enable Authentication

all

Require authentication for all MongoDB connections, though this may not fully prevent exploitation if authentication is bypassed.

mongod --auth --bind_ip_all
Edit mongod.conf: security.authorization: enabled

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate MongoDB servers from untrusted networks.
  • Deploy intrusion detection systems to monitor for exploitation attempts on MongoDB ports.

🔍 How to Verify

Check if Vulnerable:

Check MongoDB version and compare against affected versions. If version falls within affected ranges and server is accessible, it is vulnerable.

Check Version:

mongod --version | grep 'db version'

Verify Fix Applied:

Verify MongoDB version is patched (v4.4.30+, v5.0.32+, v6.0.27+, v7.0.28+, v8.0.17+, v8.2.3+ or latest for older series).

📡 Detection & Monitoring

Log Indicators:

  • Unusual connection patterns to port 27017
  • Errors related to compressed protocol handling
  • Multiple failed authentication attempts from single sources

Network Indicators:

  • Unusual traffic patterns to MongoDB default port (27017)
  • Multiple connection attempts with malformed packets

SIEM Query:

source="mongodb.log" AND ("compressed" OR "protocol" OR "malformed") OR destination_port=27017 AND (bytes_sent>threshold OR packet_count>threshold)

🔗 References

📤 Share & Export