
MongoDB CVE-2025-14847 Heap Memory Leak Scanner | OP_COMPRESSED zlib Vulnerability | Bug Bounty & Red Team Tool
MongoBleed is a high-performance PoC scanner for CVE-2025-14847, a pre-authentication heap memory disclosure vulnerability in the MongoDB C++ Driver. The tool is designed for rapid identification of vulnerable instances across large network ranges.
The vulnerability stems from an out-of-bounds (OOB) read in the MongoDB wire protocol’s handling of OP_COMPRESSED messages.
When a server receives an OP_COMPRESSED packet, it relies on the attacker-supplied uncompressedSize field to allocate a buffer for decompression. If the actual decompressed data is significantly smaller than the claimed uncompressedSize, the driver fails to truncate or clear the buffer. As a result, the server returns the entire allocated memory block, which may contain uninitialized heap data, potentially exposing sensitive information such as session tokens, internal pointers, or fragments of other database queries.
asyncio for high-concurrency scanningvulnerable_targets.txtgit clone https://github.com/Black1hp/mongobleed-scanner/
cd mongobleed-scanner
No external dependencies required (Python Standard Library only).
Basic usage:
python3 mongobleed.py -i targets.txt
Advanced configuration:
python3 mongobleed.py -i targets.txt -c 100 -t 5
-i : Input file containing targets (IP, domain, or IP:port)-c : Concurrency level (default: 50)-t : Connection timeout in seconds (default: 5)The scanner identifies vulnerability by exploiting a size mismatch during the BSON decompression phase:
OP_COMPRESSED packet containing a small zlib-compressed payload for example 16-30 bytes .uncompressedSize field in the packet header is intentionally set to a much larger value (e.g., 64KB).MessageLength that aligns with the requested large buffer size rather than the actual decompressed payload size.uncompressedSize to define the response length. Since it fails to update this length with the actual bytes written during decompression, it blindly streams the entire allocated heap buffer—including uninitialized memory—back to the client.Note: The video above demonstrates the scanner identifying multiple vulnerable instances and capturing heap fragments in real-time.
Black1hp Security Researcher | Bug Hunter | Red Teamer
This tool is intended for authorized security testing and research purposes only. The author is not responsible for any unauthorized use or damage resulting from this tool.