CVE-2025-14847 — MongoBleed
- CVE-2025-14847 (MongoBleed) kimlik doğrulaması olmadan MongoDB sunucu heap belleğini sızdırır.
- Kök neden, OP_COMPRESSED açımı sırasında istemcinin verdiği uncompressedSize değerine güvenilmesidir.
- Sızan bellek kullanıcı adı, parola, token ve yapılandırmayı açığa çıkarabilir; düzeltme sürümlerine geçin.
CVE-2025-14847, also known as MongoBleed, is a vulnerability that allows attackers to read unauthorised data from the heap memory of the server running MongoDB — without any authentication.
MongoDB is a document-oriented, open-source NoSQL database. It stores data in formats such as JSON, BSON and XML, and supports search, delete and update operations over that data.
Background
MongoDB uses a socket-based protocol called the MongoDB Wire Protocol between client and server. After a connection is established, communication happens by sending and receiving OP_MSG message packets. For performant transfer of large payloads, MongoDB uses the OP_COMPRESSED packet format.
The parameter that matters is uncompressedSize — “the size the compressed data sent from client to server will occupy in memory once it is decompressed on the server.”
Root cause
// line 72 — client value assigned to length length = uncompressedSize; // line 73 — uncompress computes the real size into length uncompress(output.data(), &length, input.data(), input.size()); // line 83 — ROOT CAUSE // length was updated, but output.length() still returns the client's size! return SharedBuffer::allocate(output.length());
Inside decompressData, memory is allocated according to the client-supplied uncompressedSize. Data is read from the server's heap in the size the client chose, and returned to the client as if it were the result of decompression. The leaked memory can contain usernames, passwords, tokens and system configuration data.
The BSON leak
Objects in MongoDB are serialised/deserialised to the client in BSON (Binary JSON). During parsing, the end of a value is detected by a \0 null terminator. When the client-supplied BSON does not end with \0, Mongo keeps scanning the allocated region for one. Since no valid BSON object forms, an error is thrown — and that error message leaks memory contents.
The fix
The vulnerability was resolved by using the real length of the decompressed data during the decompressData operation, rather than the client-supplied value.
- 8.2.x — 8.2.2 and earlier
- 8.0.x — 8.0.16 and earlier
- 7.0.x — 7.0.27 and earlier
- 6.0.x — 6.0.26 and earlier
- 5.0.x — 5.0.31 and earlier
Sıkça sorulan sorular
MongoBleed (CVE-2025-14847) nedir?
MongoDB'de kimlik doğrulaması gerektirmeyen bir heap bellek sızıntısıdır. Saldırgan özel hazırlanmış bir OP_COMPRESSED paketi göndererek sunucunun amaçlanandan fazla bellek döndürmesini sağlar; kimlik bilgileri ve token gibi heap içeriği istemciye sızar.
Hangi MongoDB sürümleri etkileniyor ve nasıl düzeltilir?
8.2.2, 8.0.16, 7.0.27, 6.0.26 ve 5.0.31 ve öncesi etkilenir. Düzeltme, istemcinin verdiği boyut yerine gerçek açılmış uzunluğu kullanır; yamalı bir sürüme yükseltmek sızıntıyı kapatır.

