Spent few days analysing MongoDB, please summarize the analysis and findings.
MongoBleed, tracked as CVE-2025-14847, an unauthenticated memory disclosure vulnerability affecting MongoDB across multiple major versions. It allows remote clients to extract uninitialized heap memory from the MongoDB process using nothing more than valid compressed wire-protocol messages.
This is not native RCE. This is not an issue on the library zlib, is more on the compression-decompression and It is a memory leak. It does not leave a lot of traces, It is silent, repeatable, and reachable before authentication.
- Full Detailed Blog: https://phoenix.security/mongobleed-vulnerability-cve-2025-14847/
- Exploit explanation and lab: https://youtu.be/EZ4euRyDI8I
- Exploit Description (llm generated from article): https://youtu.be/lxfNSICAaSc
- Github Exploit for Mongobleed: https://github.com/Security-Phoenix-demo/mongobleed-exploit-CVE-2025-14847/tree/main
- Github Scanner for web: https://github.com/Security-Phoenix-demo/mongobleed-exploit-CVE-2025-14847/tree/main/scanner
- Github Scanner for Code: https://github.com/Security-Phoenix-demo/mongobleed-exploit-CVE-2025-14847/tree/main/code-sca
(Note I spend more time writing exploits, have dyslexia, and I'm not a native English, an LLM proofreads some sections, if this offends you, stop reading)
| MongoDB Server | Vulnerable versions | Fixed versions |
|---|---|---|
| 8.2.x | 8.2.0 β 8.2.2 | 8.2.3 |
| 8.0.x | 8.0.0 β 8.0.16 | 8.0.17 |
| 7.0.x | 7.0.0 β 7.0.27 | 7.0.28 |
| 6.0.x | 6.0.0 β 6.0.26 | 6.0.27 |
| 5.0.x | 5.0.0 β 5.0.31 | 5.0.32 |
| 4.4.x | 4.4.0 β 4.4.29 | 4.4.30 |
| 4.2.x | All | EOL |
| 4.0.x | All | EOL |
| 3.6.x | All | EOL |
SAAS version of MongoDB is already patched
MongoDB supports network-level message compression.
When a client negotiates compression, each compressed message includes an uncompressedSize field.
The vulnerable flow looks like this:
Memory gets leaked out, not a lot of IOC to detect
The vulnerability originates in MongoDBβs zlib message decompression logic:
src/mongo/transport/message_compressor_zlib.cpp
In the vulnerable implementation, the decompression routine returned:
return {output.length()}; output.length() represents the allocated buffer size, not the number of bytes actually written by ::uncompress().
If the attacker declares a larger uncompressedSize than the real decompressed payload, MongoDB propagates the allocated size forward. Downstream BSON parsing logic consumes memory beyond the true decompression boundary.
The fix replaces this with:
return length; length is the actual number of bytes written by the decompressor.
Additional regression tests were added in message_compressor_manager_test.cpp to explicitly reject undersized decompression results with ErrorCodes::BadValue.
This closes the disclosure path.
Compression negotiation occurs before authentication.
The exploit does not require:
It relies on:
Any network client can trigger it, hence is super easy to deploy
A working proof of concept exists and is public, more details:
The PoC:
No credentials required.
No malformed packets.
Repeatable probing.
Heap memory is messy. That is the point.
Observed and expected leak content includes:
The PoC output already shows real runtime artifacts.
MongoBleed does not provide native remote code execution.
There is no instruction pointer control. No shellcode injection. No crash exploitation.
What it provides is privilege discovery.
Memory disclosure enables:
A leaked Kubernetes token is better than RCE.
A leaked CI token is persistent RCE.
A leaked cloud role is full environment control.
This is RCE-adjacent through legitimate interfaces.
MongoDB is everywhere.
Shodan telemetry captured on 29 December 2025 shows:
213,490 publicly reachable MongoDB instances
Version breakdown (port 27017):
| Version | Count | Query |
|---|---|---|
| All versions | 201,659 | product:"MongoDB" port:27017 |
| 8.2.x | 3,164 | "8.2." |
| 8.0.x (β 8.0.17) | 13,411 | "8.0." -"8.0.17" |
| 7.0.x (β 7.0.28) | 19,223 | "7.0." -"7.0.28" |
| 6.0.x (β 6.0.27) | 3,672 | "6.0." -"6.0.27" |
| 5.0.x (β 5.0.32) | 1,887 | "5.0." -"5.0.32" |
| 4.4.x (β 4.4.30) | 3,231 | "4.4." -"4.4.30" |
| 4.2.x | 3,138 | "4.2." |
| 4.0.x | 3,145 | "4.0." |
| 3.6.x | 1,145 | "3.6." |
Most are directly exposed on the default port, not shielded behind application tiers.
This favors patient actors and automation.
Look for:
Watch for:
Check for:
If you see filesystem artifacts or shells, you are already past exploitation.
If you cannot upgrade immediately:
These are stopgaps. The bug lives in the server - hence patch
A full test suite is available, combining:
Repository:
https://github.com/Security-Phoenix-demo/mongobleed-exploit-CVE-2025-14847
This allows:
MongoBleed does not break crypto it breaks data and memory
The database trusts client-supplied lengths.
Attackers live for that assumption.
Databases are part of your application attack surface.
Infrastructure bugs leak application secrets.
Vulnerability management without reachability is incomplete.
Patch this.
Then ask why it was reachable.