
Umfassende Analyse und Proof-of-Concept für CVE-2025-6218 - WinRAR Pfad-Traversal RCE-Sicherheitslücke, die Versionen 7.11 und älter betrifft
⚠️ KRITISCHE SICHERHEITSLÜCKE – Aktive Ausnutzung bestätigt
CVE-2025-6218 ist eine kritische Path-Traversal-Sicherheitslücke in WinRAR, die die Ausführung von beliebigem Code ermöglicht. Derzeit von APT-Gruppen wie GOFFEE, Bitter (APT-C-08) und Gamaredon ausgenutzt.
CVE-2025-6218 ist eine KRITISCHE Path-Traversal-Sicherheitslücke in WinRAR für Windows, die Angreifern die Ausführung von beliebigem Code ermöglicht.
| Aspekt | Detail |
|---|---|
| CVSS Score | 7.8 (High) |
| Verwundbare Versionen | WinRAR ≤ 7.11 (nur Windows) |
| Plattformen | Windows 10, 11, Server |
| Betroffene Nutzer | ~500 Millionen |
| Patch in | WinRAR 7.12 (Juni 2025) |
| Status | 🔴 AKTIVE Ausnutzung |
| CISA KEV | Hinzugefügt am 9. Dezember 2025 |
Ein Angreifer kann:
WinRAR validiert die Dateipfade in speziellen .rar-Archiven nicht korrekt. Wenn ein Benutzer ein manipuliertes Archiv extrahiert, können Dateien in beliebige Pfade außerhalb des vorgesehenen Extraktionsordners geschrieben werden, indem Path-Traversal-Sequenzen (../ oder ..\\) verwendet werden.
// Pseudocodice - WinRAR v7.11 (VULNERABILE) void extract_file(rar_entry *entry, char *dest_dir) { char final_path[MAX_PATH];
strcpy(final_path, dest_dir); // "C:\\Temp\\"
strcat(final_path, entry->filename); // + "..\\..\\..\\Windows\\System32\\malware.exe"
// ❌ ERRORE: Nessuna validazione del path traversal!
// final_path = "C:\\Temp\\..\\..\\..\\Windows\\System32\\malware.exe"
// Risolto come: "C:\\Windows\\System32\\malware.exe" ← EXPLOIT!
create_file(final_path); // File creato in directory non intesa
}
### Fehlende Schutzmaßnahmen in v7.11
- ❌ Keine Überprüfung, ob die Datei in `dest_dir` bleibt
- ❌ Kein Filter für Sequenzen `..` oder `.`
- ❌ Keine Pfadnormalisierung
- ❌ Keine Whitelist erlaubter Verzeichnisse
- ❌ Keine Containment-Validierung
### Der Fix in v7.12```c
// WinRAR v7.12 (PATCHED)
bool is_path_contained(char *path, char *base_dir) {
char canonical[MAX_PATH], canonical_base[MAX_PATH];
// Normalizza entrambi i percorsi
GetFullPathName(path, MAX_PATH, canonical, NULL);
GetFullPathName(base_dir, MAX_PATH, canonical_base, NULL);
// Verifica contenimento
if (strncmp(canonical, canonical_base, strlen(canonical_base)) != 0) {
return false; // Path esce dalla directory base
}
return true;
}
void extract_file_safe(rar_entry *entry, char *dest_dir) {
char final_path[MAX_PATH];
strcpy(final_path, dest_dir);
strcat(final_path, entry->filename);
// ✅ FIX: Verifica che il file rimane dentro dest_dir
if (!is_path_contained(final_path, dest_dir)) {
skip_extraction(); // Rifiuta estrazione
log_error("Path traversal detected!");
return;
}
create_file(final_path); // Adesso sicuro
}
Cartella di Estrazione: C:\Temp\Extract
Path nel RAR (craft): ..\..\..\..\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\payload.bat
Risoluzione Path: C:\Temp\Extract\.. = C:\Temp\ C:\Temp\.. = C:\ C:\.. = C:\ (non può andare oltre)
= C:\Users\\AppData\Roaming\...\Startup\payload.bat ✓
### Angriffsablaufdiagramm```
┌─────────────────────────────────────────────┐
│ 1. Attaccante crea RAR con path craft │
│ es: ..\\..\\..\\Startup\\malware.bat │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 2. Distribuzione via spear-phishing │
│ Email mirata con allegato RAR │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 3. Vittima estrae archivio con WinRAR │
│ (versione ≤ 7.11) │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 4. WinRAR non valida path traversal │
│ File estratto in Startup folder │
└─────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────┐
│ 5. Al boot: payload eseguito │
│ RAT stabilisce C2 connection │
└─────────────────────────────────────────────┘
| Version | Status | Anmerkungen |
|---|---|---|
| ≤ 7.10 | 🔴 ANFÄLLIG | Alle Exploits funktionieren |
| 7.11 | 🔴 ANFÄLLIG | Letzte anfällige Version |
| 7.12 Beta 1+ | 🟢 GEFIXT | Fix für Path Traversal |
| 7.12+ | 🟢 GEFIXT | Stabile Version mit Fix |
| UNIX / Android | ✅ NICHT BETROFFEN | Nicht-Windows-Versionen nicht betroffen |
(Get-Item "C:\Program Files\WinRAR\WinRAR.exe").VersionInfo.FileVersion
wmic datafile where name="C:\\Program Files\\WinRAR\\WinRAR.exe" get Version
## 🌍 Angriffsszenarien
### Szenario 1: Bitter/APT-C-08 Spear-Phishing (AKTIV BESTÄTIGT)
**Ziel**: Regierung, Militärorganisationen, strategische Institutionen```
Email Phishing:
From: [email protected]
Subject: "Provision of Information for Sectoral for AJK.rar"
Attachment: Provision_of_Information.rar
Contenuto Archive:
├── Document.docx (esca legittima - report convincente)
└── ..\\..\\..\\..\\Users\\User\\AppData\\Roaming\\Microsoft\\Office\\STARTUP\\Template.dotm
(macro malato nascosto)
Esecuzione:
1. Vittima estrae RAR
2. WinRAR non valida path → Template.dotm finisce in Office STARTUP
3. Prossimo avvio Word → Macro eseguita automaticamente
4. PowerShell downloader attivato
5. C# Trojan scaricato: WmRAT, MiyaRAT, ZxxZ
6. C2 Server: johnfashionaccess.com
7. Capabilities:
- Keylogging
- Screenshot capture
- RDP credential stealing
- File exfiltration
- Lateral movement
Ziel: Russische Regierungsorganisationen``` RAR specializzato: ├── run.bat (path: ..\..\..\..\Windows\Startup\run.bat) └── legitimate_document.pdf (esca)