MongoDB Zlib compression vulnerability (CVE-2025-14847)¶
The mongodb_cve_2025_14847_zlib check warns if a MongoDB instance is affected by CVE-2025-14847 and receives Zlib-compressed network traffic.
Description¶
CVE-2025-14847 is a vulnerability in the Zlib network compression of MongoDB Server. Mismatched length fields in Zlib-compressed protocol headers enable an unauthenticated client to read uninitialized heap memory of the server. MongoDB rates the vulnerability as High, with a CVSS 4.0 base score of 8.7.
The following MongoDB releases fix the vulnerability:
- 4.4: 4.4.30
- 5.0: 5.0.32
- 6.0: 6.0.27
- 7.0: 7.0.28
- 8.0: 8.0.17
- 8.2: 8.2.3
Release series 3.6, 4.0 and 4.2 reached end of life and don’t get a fix.
The check reads the server version with the buildInfo command and the Zlib-compressed traffic that the instance received over the last 24 hours. The check returns a warning if both of these are true:
- The instance received Zlib-compressed traffic in the last 24 hours.
- The version is older than the fixed release of its release series, or the release series has no fix.
The check treats a release series that the previous list doesn’t include as having no fix if it’s older than 8.2, such as the 8.1 rapid release, and as fixed if it’s newer, such as 8.3 or 9.0. For Percona Server for MongoDB, the check compares the MongoDB version that the release is based on.
Resolution¶
The check doesn’t report an affected instance that received no Zlib-compressed traffic in the last 24 hours. Such an instance is still vulnerable if Zlib is in its list of network compressors, which it is by default, so check every instance that runs an affected version.
Upgrade MongoDB to the fixed release of your release series, or to a later one. If you run release series 3.6, 4.0 or 4.2, upgrade to a supported release series.
If you can’t upgrade right away, remove Zlib from the network compressors of every mongod and mongos:
-
Edit the configuration file and list only the compressors other than Zlib:
net: compression: compressors: snappy,zstdTo turn off network compression completely, set
compressorstodisabled. On the command line, use the--networkMessageCompressorsoption instead. -
Restart the instances to apply the change. For a replica set, restart the members one at a time.
To learn more about the vulnerability, read CVE-2025-14847 in the National Vulnerability Database (NVD) and SERVER-115508 in the MongoDB issue tracker.
Need more support from Percona?¶
Percona experts bring years of experience in tackling tough database performance issues and design challenges.