May 11, 2026, 10:52 PM
This critical vulnerability allows an unauthenticated attacker to gain root-level access to a cPanel/WHM server by bypassing the standard authentication mechanism. It is a prime example of how multiple minor logic flaws can be chained together to create a catastrophic security failure.
1. Vulnerability Root Cause: Why Did It Happen?The vulnerability is essentially an Authentication Bypass resulting from improper session data handling. It stems from three primary failures:
2. The Exploitation Chain: How to Gain Root AccessAn attacker follows a 5-step "Exploitation Chain" to take over the server:
Step 1: Initialize a Pre-Auth SessionThe attacker sends a failed login request (e.g.,
) to
.
). The cPanel security engine checks the session and finds the injected
flag.
3. The Fix: How It Was PatchedcPanel developers implemented a "defense-in-depth" strategy to close this loop:
1. Vulnerability Root Cause: Why Did It Happen?The vulnerability is essentially an Authentication Bypass resulting from improper session data handling. It stems from three primary failures:
- Sanitization Failure (CRLF Injection): The
binary (the core cPanel service) processes "Basic Authentication" headers. While it strips NUL (cpsrvd
) bytes from the password field, it fails to sanitize Carriage Return/Line Feed (\0
) characters.\r\n
- Lack of Global Filtering: The
function, responsible for writing session data to disk, previously assumed that the data had already been cleaned by callers. However, several entry points (like Basic Auth) bypassed thesaveSession
function.filter_sessiondata
- Encryption Bypass (No-Ob Vulnerability): cPanel normally encrypts session files. The encryption key is derived from a hex string in the session cookie (the
part). If an attacker removes this hex string from the cookie, the system fails to initialize the encoder and writes the session data to the disk in plaintext.ob
2. The Exploitation Chain: How to Gain Root AccessAn attacker follows a 5-step "Exploitation Chain" to take over the server:
Step 1: Initialize a Pre-Auth SessionThe attacker sends a failed login request (e.g.,
user=root&pass=wrongPOST /login/- Result: The server rejects the login but creates a "pre-auth" session file on the disk and issues a session cookie:
.whostmgrsession=:ABC_123,hex_key
- New Cookie:
whostmgrsession=:ABC_123 - Impact: When the server updates this session, it will now write to the file in plaintext because it cannot find the
to start the encryption engine.hex_key
- Payload:
password\nhasroot=1\ntfa_verified=1\nsuccessful_internal_auth_with_timestamp=1777462149 - Result: Because of the sanitization failure, the server writes this directly to the session file. The
characters force the server to interpret\n
as a new, high-privilege configuration line.hasroot=1
- Impact: The system is forced to re-read the raw session file from the disk and update the JSON cache. Now, the attacker’s "fake" privileges are loaded into the system's active memory.
/scripts2/listacctssuccessful_internal_auth_with_timestamp- Outcome: As seen in the code:
. The system assumes the user is already validated and never consults thereturn $Cpanel::Server::AUTH_OK, 0;
file for a password. The attacker is now Root./etc/shadow
3. The Fix: How It Was PatchedcPanel developers implemented a "defense-in-depth" strategy to close this loop:
- Mandatory Filtering: The
function now callssaveSession
internally by default. No matter where the data comes from,filter_sessiondata
characters are stripped before hitting the disk.\r\n
- Deterministic Encoding: If the encryption key (
) is missing, the system no longer reverts to plaintext. It now uses a fallbackob
method and prefixes the data withhex_encode_only
. This ensures that even if a payload is injected, it remains an unreadable hex string and cannot be executed as a command.'no-ob:'
- Patched Versions: This vulnerability is fixed in the following versions (and later):
- 110.0.97
- 118.0.63
- 126.0.54
- 132.0.29
- 134.0.20
- 136.0.5
- 110.0.97
