- CVE-2026-41940 is a critical authentication bypass in cPanel & WHM, affecting all currently supported branches and widely deployed hosting platforms.
- Attackers abuse session handling flaws in cpsrvd to inject crafted values into session files, eventually gaining root-level access without knowing any valid password.
- Exploitation has been observed in the wild since at least late February, with mass scanning, brute-force attempts, and real-world probing of exposed cPanel instances.
- Administrators must urgently patch and harden by updating to fixed builds, restricting ports 2083/2087/2095/2096, and hunting for indicators of compromise.
In late April 2026, security researchers revealed a critical flaw in cPanel & WHM that quietly turned millions of hosting servers into high‑value targets. The bug, now tracked as CVE‑2026‑41940, allows attackers to slip past normal login checks and end up holding the keys to the hosting control panel — no valid password required.
The issue affects a product that underpins a huge slice of the web: cPanel powers tens of millions of domains worldwide, with WebHost Manager (WHM) used by providers to manage entire fleets of customer accounts. When the same vulnerability hits both the administrative plane and user control panels, the blast radius is enormous.
What are cPanel and WHM, and why this bug matters so much

At a high level, cPanel is the web-based dashboard that hosting customers use to manage their individual sites: set up email accounts, upload files, tweak PHP versions, and so on. WHM (WebHost Manager) sits above that, giving hosting providers root-level control over all those cPanel accounts on a server.
In other words, WHM is the administrative interface with system‑wide privileges, while cPanel is the tenant‑level interface for each hosted customer. Compromise WHM, and you effectively compromise every site, database and user on that machine. Compromise cPanel directly, and you own that customer’s entire presence.
The vulnerable component at the center of CVE‑2026‑41940 is cpsrvd, the cPanel service daemon. It handles HTTP(S) requests to both cPanel and WHM, orchestrating session handling, authentication, and the security token system that protects privileged actions, aspectos que analiza la evolución de APIs y seguridad.
At a high level, cPanel is the web-based dashboard that hosting customers use to manage their individual sites: set up email accounts, upload files, tweak PHP versions, and so on. WHM (WebHost Manager) sits above that, giving hosting providers root-level control over all those cPanel accounts on a server.
Understanding CVE-2026-41940: a deep dive into the authentication bypass

CVE‑2026‑41940 is described by vendors as “missing authentication for a critical function”, but under the hood it is really about how cpsrvd creates and updates session files before a user is fully authenticated. Researchers from watchTowr Labs and Rapid7 independently unpacked the chain of issues that, combined, lead to a reliable authentication bypass.
When a client attempts to log in, cpsrvd creates a new session on disk even if the password is wrong. This “preauth” session stores metadata such as IP address, a preliminary cp_security_token, and some flags that track the login state. The session name is also reflected back to the client in a cookie called whostmgrsession.
That cookie contains two parts: a base identifier and a per‑session secret, separated by a comma. After URL decoding, it looks like this pattern:
:RandomSessionID,32hexcharacters
The random suffix — often called the ob segment in the code — acts as a key used by Cpanel::Session::Encoder to obfuscate the stored password field in the session file. As long as that ob value exists and is used consistently, the password value written to disk is encoded rather than appearing in cleartext.
The trouble begins when cpsrvd’s session logic is combined with HTTP Basic authentication. In the vulnerable flow, cpsrvd parses an Authorization: Basic ... header, decodes the credentials into user:pass, and passes the raw password into the session-saving function with almost no sanitisation. Aside from stripping NUL bytes, special characters like carriage return and line feed (\r\n) are left untouched.
That password is then handed to Cpanel::Session::saveSession, which writes the session file in a simple key=value format, one entry per line. In older builds, the code assumed the password would always be encoded, and relied on callers to remember to clean dangerous characters using a helper called filter_sessiondata. In practice, not every caller did.
How the exploit manipulates session files to gain root access
The exploit chain uncovered by watchTowr and others shows how these design choices can be turned into a reliable, unauthenticated admin login. The broad idea is to inject extra key‑value pairs into the on‑disk session file so that, once reloaded, the session looks like it belongs to a fully authenticated root user.
The attack unfolds in several stages:
-
Mint a preauth session. The attacker sends a normal login attempt to the WHM interface (for example, on port 2087) with incorrect credentials. cpsrvd responds with a 401 error but also creates a new session file under
/var/cpanel/sessions/raw/and sets awhostmgrsessioncookie containing:RandomSessionID,obhex. -
Strip the
obsecret from the cookie. In a follow‑up request, the attacker resends the cookie but omits the comma and the trailing hex value, leaving only:RandomSessionID. Internally, cpsrvd can still find the corresponding session file, but now the session‑encoding logic sees an emptyob, so it skips encoding of the password field entirely. -
Inject raw
\r\nvia Basic auth. The attacker chooses credentials such that the decoded password looks like a small string followed by line breaks and additionalkey=valuepairs, for example:
x\r\nhasroot=1\r\ntfa_verified=1\r\nuser=root\r\ncp_security_token=/cpsess9999999999\r\nsuccessful_internal_auth_with_timestamp=1777462149Because no CRLF filtering is applied before writing the session, those
\r\nbytes are interpreted as line breaks. Once flushed to disk, the session file now contains genuine top‑level lines likehasroot=1,user=rootandsuccessful_internal_auth_with_timestamp=.... -
Deal with the JSON cache. By default, cpsrvd doesn’t always read directly from that raw text file. To speed things up, it also keeps a JSON‑encoded cache of the same session data under a parallel
cache/directory. When the session was first created, the cache did not include the attacker’s forged top‑level keys, and subsequent loads prefer this cache. -
Force a reload from the raw file. To make the injected lines “visible” to later requests, the attacker must trigger code that re‑parses the raw session and overwrites the cache. Researchers found just such a path in
Cpanel::Session::Modify, which reads from the raw file when instructed not to use the cache and then rewrites both the text file and the JSON snapshot. -
Trigger a token‑denied path. The function
do_token_denied, called when a request is missing or presents an invalidcp_security_token, usesSession::Modifyto increment atoken_deniedcounter in the session. That is exactly the behaviour the attacker wants: it re‑parses the raw session (including injected keys) and saves the updated structure back into the cache.
After provoking a “Token Denied” response by visiting a privileged URL without any cpsess... prefix, the updated cache now shows entries like hasroot=1, tfa_verified=1, user=root and successful_internal_auth_with_timestamp as first‑class attributes of the session hash.
From that point on, whenever cpsrvd loads this session for subsequent requests, it treats the connection as associated with the root account, with two‑factor checks marked as passed and root‑level capabilities granted. Crucially, downstream password checks are quietly short‑circuited.
Why password validation gets skipped entirely
Even after the injected session state is in place, cpsrvd still invokes its usual authentication routines for each new request. Under normal circumstances, these routines compare the presented password with the appropriate entry in /etc/shadow or another back‑end, denying access if the credentials are wrong.
The difference in this case is a pair of timestamps tracked inside the session: successful_external_auth_with_timestamp and successful_internal_auth_with_timestamp. These fields are meant to record that the user successfully authenticated through an external or internal mechanism.
When one of these timestamps is present and non‑empty, the code path in docheckpass_whostmgrd hands control to a helper that returns “AUTH_OK” immediately, without consulting /etc/shadow or validating the provided password at all. The assumption is that a prior, trusted authentication step has already done the required checks.
By injecting a plausible value into successful_internal_auth_with_timestamp and turning it into a top‑level session key, the attacker effectively sets a permanent “already authenticated” flag for the lifetime of that session. Every subsequent HTTP request that references this session ID gets treated as authenticated, with root permissions if hasroot=1 is also present.
That combination — forged user identity, root privileges, and bypassed password checks — is why CVE‑2026‑41940 scores so highly on severity scales and is being described as an authentication bypass rather than a mere escalation bug.
Vendor patches and changes in session handling
Once the vulnerability came to light, cPanel’s vendor, WebPros International, shipped patches across all currently supported branches. The advisory highlights fixes in the following versions:
- cPanel & WHM 110.0.x – patched in 11.110.0.97 (previously 11.110.0.96)
- cPanel & WHM 118.0.x – patched in 11.118.0.63 (previously 11.118.0.61)
- cPanel & WHM 126.0.x – patched in 11.126.0.54 (previously 11.126.0.53)
- cPanel & WHM 132.0.x – patched in 11.132.0.29 (previously 11.132.0.27)
- cPanel & WHM 134.0.x – patched in 11.134.0.20 (previously 11.134.0.19)
- cPanel & WHM 136.0.x – patched in 11.136.0.5 (previously 11.136.0.4)
According to the vendor’s documentation, all supported releases after roughly v11.40 were exposed prior to these updates, as well as some hosting platforms built on top of cPanel, such as later builds of WP Squared.
Under the hood, cPanel engineers amended the session handling logic in several key ways:
- Centralised sanitisation – the
filter_sessiondatafunction, which strips risky characters such as\r,\n,=and commas from session entries, is now called internally fromsaveSessionitself instead of relying on each caller to use it correctly. - Stricter handling of the
obsecret – the patched code verifies that theobcomponent of the cookie is defined and non‑empty before using it. If it’s present, the password is encoded as before; if it’s missing, the value is now tagged and hex‑encoded in a way that prevents injection of raw control characters. - Safer round‑tripping of data – new helper functions in
Cpanel::Session::Encoderintroduce explicit primitives for encoding and decoding session values in hex only, reducing the risk of untrusted strings being written to disk unmodified.
These adjustments collectively aim to close off the path where a malformed cookie suppresses password encoding and where unfiltered CRLF sequences can shape the structure of session files. They do not fundamentally change cPanel’s reliance on sessions as a state machine across requests, but they harden that mechanism against the specific bypass described in the public research.
Real-world exploitation and the disclosure timeline
One of the more worrying aspects of CVE‑2026‑41940 is that attackers appeared to be exploiting it before detailed write‑ups were released. Managed hosting provider KnownHost reported observing exploitation attempts as early as February 23, 2026, suggesting that at least some threat actors had figured out the bug independently.
WebPros published its official security advisory on April 28, 2026, and pushed out updated builds shortly afterwards. Hosting providers that were privately informed responded by rapidly blocking access to cPanel and WHM login ports across their networks, then rolling out patches at scale.
Accounts of the disclosure process differ slightly. Sources quoted by industry media indicate that the issue may have been reported to cPanel roughly two weeks before the public advisory, and that the initial response downplayed or did not fully acknowledge the problem. It is not clear whether the original reporter was already aware of in‑the‑wild abuse at that time.
The gap between initial reports, visible exploitation and broad public guidance has raised questions among some operators about how information about high‑impact hosting vulnerabilities is shared with downstream providers. In this case, a number of hosting companies said they would have preferred earlier and more explicit communication of risk and mitigations while patches were still being prepared.
Shortly after the advisory, the US Cybersecurity and Infrastructure Security Agency (CISA) added CVE‑2026‑41940 to its Known Exploited Vulnerabilities catalog, effectively making timely remediation a requirement for many government and regulated entities. The Shadowserver Foundation reported seeing tens of thousands of unique IPs scanning and attempting exploits against honeypots, alongside hundreds of thousands of exposed cPanel/WHM endpoints across the internet.
Potential impact of a successful compromise
If CVE‑2026‑41940 is successfully exploited, the consequences extend well beyond a single user account. As Rapid7’s analysis put it, an attacker can gain full control of the cPanel host system, including server configuration, databases, and all websites managed by that instance.
With root‑level WHM access, an attacker can, for example:
- Modify or replace website content across all hosted accounts
- Harvest or tamper with databases containing customer or application data
- Plant webshells and backdoors for long‑term persistence
- Deploy malware or phishing pages at scale, abusing the server’s reputation
- Rotate through domains and user accounts as staging points for further attacks
They also gain visibility into server‑level credentials, configuration files and potentially API keys that may link into external services. In multi‑tenant shared hosting environments, that attack surface can grow quickly, especially when combined with weak segregation between accounts or outdated web applications.
Some providers that carefully monitored exploitation attempts on their networks described initial probes as more exploratory than destructive — more “does this work?” than “wipe the system”. Nevertheless, the same access could fairly easily be repurposed for ransomware, mass defacement, data theft or supply‑chain compromise if monetisation or disruption becomes the goal.
Which versions and platforms are affected
According to vendor guidance and independent reporting, all cPanel & WHM releases after v11.40 were vulnerable until they received the April 28 fixes. That includes numerous long‑lived branches that remain in use on production servers worldwide.
Security notes and hosting advisories highlight that the following branches required updates to remediate the issue:
- Versions prior to 11.86.0.41
- Versions prior to 11.110.0.97
- Versions prior to 11.118.0.63
- Versions prior to 11.126.0.54
- Versions prior to 11.130.0.19
- Versions prior to 11.132.0.29
- Versions prior to 11.134.0.20
- Versions prior to 11.136.0.5
For each of these tracks, administrators are expected to be on the corresponding patched builds (such as 11.110.0.97, 11.118.0.63, 11.126.0.54, 11.132.0.29, 11.134.0.20 and 11.136.0.5) to be protected against this specific vulnerability.
Beyond core cPanel & WHM installations, managed platforms that embed cPanel as a component — for example, WP Squared’s managed WordPress hosting offering — were also impacted and had to release their own updates based on the upstream fixes.
Mitigation steps for administrators and hosting providers
Given the combination of active exploitation and broad exposure, administrators are being urged to treat patching for CVE‑2026‑41940 as a priority. Vendor recommendations and independent experts broadly suggest the following steps:
- Update to a patched version of cPanel & WHM on every affected server. After upgrading, verify the build number matches one of the fixed releases listed in the security advisory.
- Restart the cpsrvd service (and related components like
cpdavd) to ensure all changes are applied and that no lingering vulnerable processes remain in memory. - Restrict public access to management ports wherever feasible. That typically means limiting exposure of ports 2083, 2087, 2095 and 2096 to specific administrative networks or VPNs, rather than leaving them open to the entire internet.
- Deploy temporary firewall rules or upstream filtering to block known malicious IP ranges or unusual scanning patterns associated with cPanel/WHM probing.
- Run vendor‑supplied detection scripts to search for known indicators of compromise (IoCs), such as suspicious session files or unexpected administrative logins.
Hosting companies that reacted quickly reported stepping through these actions in roughly that order: first block inbound access to the login interfaces to buy time, then push the patched packages, restart services, and only then gradually reopen carefully filtered management access.
On top of the vendor guidance, many security teams are combining external attack surface monitoring with active testing to confirm that exposed cPanel instances are no longer vulnerable. Some have adopted tools that can generate non‑destructive probes specifically for CVE‑2026‑41940, allowing them to distinguish between patched and unpatched deployments in large fleets without triggering instability on production servers.
What security teams should watch for going forward
From a defender’s perspective, CVE‑2026‑41940 serves as a reminder that seemingly minor assumptions in session management can have major consequences once they are combined and driven from untrusted input. The bug also underscores how long a serious flaw can remain in place when it touches complex authentication flows that evolved over many releases.
Looking ahead, teams responsible for cPanel and WHM deployments may want to:
- Review logging and alerting around WHM/cPanel logins, especially for patterns such as repeated “Token Denied” responses followed by apparently successful administrative sessions.
- Harden access paths by enforcing VPN‑only or IP‑restricted access to control panels, and by avoiding direct exposure of management interfaces where operationally possible.
- Re‑evaluate reliance on long‑lived sessions, particularly those that effectively bypass password validation once certain flags are set, and consider shorter session lifetimes or stricter re‑authentication for sensitive actions.
- Adopt continuous security testing inside and outside the network, so that emerging vulnerabilities in common control planes are discovered and remediated more quickly.
For smaller site owners and agencies who simply rent hosting, much of the heavy lifting sits with their providers, but it is still worth confirming that the underlying cPanel environment has been updated and that management interfaces are not unnecessarily exposed. Where providers share timely status updates and technical details, customers are in a better position to assess risk and respond if issues arise.
As the dust gradually settles, CVE‑2026‑41940 is likely to be referenced for some time as an example of how deeply intertwined components like cookies, session files, caching layers and security tokens can be subtly misused — and how, once those pieces are lined up, a straightforward HTTP request can quietly turn into full administrative control over an entire shared hosting server.