MongoBleed: patch the database, then change its keys
A MongoDB flaw let anyone who could reach a server read pieces of its memory, passwords included, without logging in. Patching was only half the fix.
Published · 4 min read

On 29 December the US Cybersecurity and Infrastructure Security Agency (CISA) added MongoBleed, CVE-2025-14847, to its catalogue of vulnerabilities exploited in attacks. The flaw let anyone who could reach a MongoDB server over the network read pieces of its memory, before the server ever asked for a password. BleepingComputer reported that what leaks can include passwords, cloud keys and session tokens. A patch closes the hole, but it cannot recall a password that has already left, so the fix has a second half.
MongoDB says its own engineers found the problem on 12 December, patched Atlas, its hosted service, by 18 December, and published the flaw on 19 December. Fixed releases for self-hosted servers were available by then: 8.2.3, 8.0.17, 7.0.28, 6.0.27, 5.0.32 and 4.4.30. A working exploit was public by 26 December, and on 28 December the cloud security firm Wiz reported attacks using it. The day before, the internet scanning firm Censys had counted more than 87,000 potentially vulnerable MongoDB servers on the public internet.
How a database leaks before anyone logs in
The bug is in how the server unpacks compressed network messages. A malformed message claiming to be larger than it is makes the server send back a block of its own memory, and because the unpacking happens before authentication, no account is needed. What comes back is whatever happened to be in that memory. An attacker cannot choose what leaks, Rapid7 notes, so the trick is repeated: attacks seen in the wild, Wiz says, often open thousands of connections to scrape as much memory as they can.
None of it would matter if those servers did not answer strangers. A database normally serves one or two applications on known machines. One that accepts connections from anywhere on the internet is a single bug away from a story like this, and there is always another bug.
Why patching is only half the fix
Rapid7's advice is the part that is easy to skip. Because the flaw leaks secrets from memory, patching alone is insufficient, it says: assume that any secret in the database's memory before the patch may be compromised, and change every database password, API key and application secret once the patch is in. A patch stops the leak. It does nothing about a password copied before the patch went on, which keeps working until somebody changes it.
A business system's database can hold more than its own passwords: the key for the payment gateway, the token for cloud storage, the login for the mail service that sends its notices. Each one has to be found, replaced and tested. An office that has never done that learns how on the worst possible day.
What it means for any system with a database
None of this is particular to MongoDB. Every database, including the PostgreSQL I build on, should answer only the servers that need it, and every key a system holds should be replaceable on an ordinary afternoon. That is easier when the keys are yours. Everything I build runs in the client's own accounts, as my answers to the usual questions set out, so the client can change any key without waiting for me.
What I would ask whoever built your system is simpler still: a list of every secret it uses, where each one is kept and what it opens. If nobody can write that list, nobody can change them in a hurry.
Five checks for any database you run
- Ask whether your database answers the internet. The answer you want is no: it should accept connections only from the application servers that use it, through a firewall rule or a private network.
- Treat a flaw like this as an emergency, not a job for the next maintenance window. MongoBleed had a public exploit a week after its fix.
- After patching anything that leaked memory, change the database passwords and every key the system keeps, then test that each connection still works.
- Keep the database logs where someone reads them. One published way to spot this attack was a single address making hundreds or thousands of connections that never send the usual client details.
- Retire versions that no longer get fixes. Older MongoDB versions past their end of life were not getting an official patch, Rapid7 notes.
If nobody in your office can say where your database runs or who holds its keys, that is worth finding out before the next flaw, and the fit check is a good place to start.
Sources
- Cybersecurity and Infrastructure Security Agency, CISA Adds One Known Exploited Vulnerability to Catalog, 29 December 2025
- MongoDB, MongoDB Server Security Update, December 2025, 29 December 2025
- BleepingComputer, Exploited MongoBleed flaw leaks MongoDB secrets, 87K servers exposed, 28 December 2025
- Wiz, MongoBleed (CVE-2025-14847) exploited in the wild: everything you need to know, 28 December 2025
- Rapid7, MongoBleed CVE-2025-14847: Critical Memory Leak in MongoDB Allowing Attackers to Extract Sensitive Data, 29 December 2025
Enrique Lacambra III builds internal business systems from Cainta, Rizal.
Tell me what is broken and I will tell you if it is worth building. A 20-minute call, no charge, and I will say so if you do not need me.
