Skip to content
Info disclosure Write-up Intermediate

MongoBleed (CVE-2025–14847): How One Missing Line of Code Expos

MongoDB did not verify that the decompressed size of a message matched the client-declared uncompressedSize, leaving uninitialised heap memory exposed. An attacker could send a malformed BSON message without a null terminator to read leftover memory containing passwords, tokens, and other sensitive data, all without authentication.

Dhanush N Follow

Published on blog.dhanushnehru.got-a.page

In December 2025, security researchers uncovered a severe vulnerability in MongoDB nicknamed “MongoBleed” (CVE-2025–14847). This bug affected nearly every MongoDB version since 2017, potentially exposing passwords, API keys, customer data and other sensitive information stored in database memory.

Dhanush N, on blog.dhanushnehru.got-a.page

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server failed to validate that the actual decompressed data length matched the client-supplied uncompressedSize, and BSON parsing read beyond the provided buffer into uninitialised memory.

Impact

An unauthenticated attacker with network access could read sensitive data from database memory, potentially including passwords, API keys, and customer information.

What the attacker needed

Network access to a MongoDB instance; no authentication required

The fix

MongoDB should validate that the decompressed size matches the claimed uncompressedSize and ensure BSON parsing does not read beyond the provided buffer; the text states a fix was released in MongoDB 8.0.17.

How it was found

  1. Send a compressed message claiming a large uncompressed size but containing only a small amount of real data.
  2. The server allocates a buffer of the claimed size and decompresses the small data into it, leaving the rest uninitialised.
  3. Send malformed BSON data without a null terminator so the parser reads past the provided data into the leftover memory.
  4. The server returns an error message containing the over-read memory, which may include sensitive information.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When MongoDB receives compressed data, it reserves memory based on a size the sender claims. If the sender lies and sends less data, the unused memory still holds old information from previous operations. The server then returns that leftover memory in error messages, letting attackers steal secrets without logging in.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Dhanush N

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.