# MongoBleed (CVE-2025-14847) exploited in the wild: everything you need to know

MongoDB zlib decompression trusts attacker-controlled uncompressedSize, leaking uninitialized heap memory to unauthenticated clients; exploited in the wild.

- Payout: Real-world hack
- Severity: high
- Program: MongoDB Server
- Credited: Wiz Research
- Disclosed: 2025-12-28
- CVE: CVE-2025-14847
- Write-up quality: 7/10
- Original: https://www.wiz.io/blog/mongobleed-cve-2025-14847-exploited-in-the-wild-mongodb
- Library page: https://bugbountylibrary.com/r/blog%3Awiz-io-blog-mongobleed-cve-2025-14847-exploited-in-the-wild-mongodb
- Tags: domain:network impact:data-leak impact:mass-exploit kind:incident platform:threat-intel sev:high tech:linux technique:incomplete-fix technique:source-review vuln:info-disclosure vuln:memory-corruption

**Target:** MongoDB Server OP_COMPRESSED network message handler (zlib decompression)
**Root cause:** message_compressor_zlib.cpp returned the allocated buffer size (output.length()) instead of the actual decompressed data length, so a malformed OP_COMPRESSED header with a lying uncompressedSize causes the server to parse uninitialized heap memory as BSON.
**Steps:**
1. Send a malformed OP_COMPRESSED message with a valid minimal BSON doc `{"a": 1}` zlib-compressed but with uncompressedSize set far larger than actual data.
2. Server allocates a large heap buffer based on the fake size, decompresses the tiny payload into the start, leaving the rest as dirty uninitialized memory.
3. Server parses the whole buffer as BSON; after the valid doc it reads dirty memory and errors, quoting invalid bytes back to the client.
4. Repeat many connections to scrape leaked heap fragments (game of chance); detect via Nuclei packet `2a0000000100000000000000dc070000dd0700003200000002789c636080028144064620050002ca0073` and check response for BSON signature.
**How found:** Code review of zlib decompression logic identified the length mismatch (output.length() vs actual decompressed length) and the pre-auth reachability of the message parser; PoC by Joe Desimone of Elastic Security.
**Exploitation:** Unauthenticated attacker floods the server with thousands of crafted OP_COMPRESSED packets, each triggering a buffer over-read; parser error messages quote leaked heap bytes, allowing gradual scraping of in-memory data and credentials. Public exploit since Dec 26, 2025; observed in the wild and added to CISA KEV.
**Insight:** Compression layers processed before authentication are prime over-read targets: audit where a decompressor returns allocated buffer size rather than actual decompressed length, and craft headers with inflated uncompressedSize to expose dirty heap via parser error messages.
