DEV Community

Damiano
Damiano

Posted on Originally published at damianobianda.hashnode.dev

The Recovery Code Was Also the API Key: What Control Web Panel's Twin Flaws Actually Teach

On November 16, VulnCheck published a coordinated disclosure of two critical vulnerabilities in Control Web Panel (CWP, formerly CentOS Web Panel), a hosting control panel that, by VulnCheck's own scan-derived count, runs on roughly 124,000 internet-facing servers - close to the 126,000 that Shodan returns for the cwpsrv banner. Both vulnerabilities are credited to researcher Valentin Lobstein (Chocapikk), both were assigned CVEs through VulnCheck's CNA on November 13, and both turn on a single primitive: the password-recovery code CWP stores in its oauth_authorization_codes table.

CVE-2026-124020 steals that code on the way to the mailbox. CVE-2026-124021 spends the same kind of code somewhere it was never meant to work: the administration API. Each path ends in a shell as the hosting account. The fix, per VulnCheck, is Control Web Panel 1.30.6.

One row, two acceptance paths

When a CWP user requests a password reset, the panel writes a single-use authorization_code into the oauth_authorization_codes table, keyed to the account, and emails a link carrying that code as an idsession parameter. Click, verify, new password, code consumed. That is the design.

The two CVEs are two different code paths that accept that one row. The first accepts it in the reset flow it was built for, but hands it to the attacker first. The second accepts it as an OAuth authorization for the remote administration API on port 2304. A secret meant for one purpose became a credential for two.

CVE-2026-124020: the reset link points wherever the attacker says

The public lost-password wrapper at /login/index.php?acc=lostpass takes a username and an email. On an exact match it queues a reset mail; on a mismatch it returns 0 instead of 1, which makes it a quiet oracle for validating account-name/email pairs before doing anything noisy.

The actual bug is in how the reset link is built. The wrapper copies the unauthenticated HTTP Host header into the loopback request it makes to the internal reset route, and that route uses the caller-supplied host as the authority of the URL it emails. The mail goes to the real account owner - but the link inside points at the attacker's listener.

Here is the part that removes the human from the loop: the link does not need a click from the victim. Mail-security scanners that follow links before delivery open it automatically, and the live recovery code lands on the attacker's server either way. The attacker replays the code at /login/index.php?acc=newpass, sets a new password, logs into the user panel, and reaches code execution through two ordinary features: the File Manager, which accepts a self-removing PHP upload under the account's tmp directory, and the Crontab module, which schedules it to run once a minute. The callback runs as the hosting account, not root - but that account owns every file, database, and subdomain under it.

VulnCheck's Initial Access team packaged the chain as a self-contained go-exploit module. In its published run log, the reset mail was queued at 14:59:11 and the shell arrived at 15:00:01 - about fifty seconds, most of it waiting for the cron minute. A separate Python proof of concept for this CVE, published under the LLCForge account on GitHub on November 16, reproduces the same path and notes the password takeover is reliable across affected builds while the RCE stage is best-effort because the upload and cron endpoints vary.

CVE-2026-124021: the administration API takes a recovery code as authorization

CWP ships an optional remote administration API on port 2304, meant for billing, provisioning, WHMCS, and migration tooling. Its authorization routine, validate(), reads a caller-supplied adds array and looks the pair (adds[user], adds[token_id]) up in the recovery-code table with a single SELECT. A live password-recovery row passes.

The call is gated by two more fields, and both look like secrets without being them. The first is adds[session_id], which the disclosure describes as a formality. The second is a legacy daily signature: an MD5 over the server hostname, the username, the current date, and the literal string "softaculous" - for which "fantastico" is also accepted. Every input is knowable: the hostname is presented as the CommonName of the port 2304 TLS certificate, so the attacker reads it off the certificate and reconstructs the signature. The configured API key is no obstacle either: per the disclosure, a syntactically valid dummy top-level key passes, because the recovery-code branch returns before the code ever reaches the configured key file.

With that authorization, POST /v1/cronjobsusers/ writes an arbitrary cron line for the account and installs it with crontab -u, executing as the hosting account on the next minute. The GitHub Advisory Database entry for this CVE adds a second impact: the same token unlocks global account-list and account-detail routes, exposing usernames, contact emails, and password hashes. In VulnCheck's published module log, the capture-to-shell span for this path was five seconds.

There is one real mitigating factor: CWP's bundled CSF firewall blocks port 2304 inbound by default, so this CVE applies to the subset of servers where the API was deliberately exposed - which, the disclosure notes, CWP's own documentation instructs for billing and WHMCS integrations. CVE-2026-124020 has no such narrowing: the lost-password endpoint lives on the public user panel, the surface that makes CWP reachable in the first place.

Both CVEs carry a CNA-assigned CVSS 4.0 score of 9.2 (critical); the CVSS 3.1 assessment recorded for CVE-2026-124021 is 8.1. As of November 14, pwned.coffee's tracking page listed no known exploitation.

The fix, and the quiet part

VulnCheck states that Control Web Panel 1.30.6 addresses both issues: reset links are built from the server's configured hostname instead of the request Host header, recovery codes become genuinely single-use, and the administration API no longer accepts a recovery code in place of API authorization.

One detail worth sitting with: the vendor's public changelog dates release 1.30.6 to November 10 - three days before the CVE records went live on November 13, and six before the disclosure. The 1.30.6 changelog entry, as published, enumerates login, mail, backup, and PHP fixes without naming these vulnerabilities; the security substance surfaces indirectly, for instance in a later note explaining that "the 1.30.6 security change made the local integration token single-use." Fixes that ship before their own descriptions are normal in coordinated disclosure, but they leave operators who skim release notes without a reason to hurry. Operators who cannot update immediately should keep port 2304 off the public internet and restrict the user panel to known networks; the LLCForge write-up adds two detections worth having: acc=lostpass requests whose Host header does not match the panel hostname, and password resets the account owner never initiated.

What it actually teaches

A recovery code is a one-time secret with one job. CWP built a reset link that trusts an unauthenticated header, which let an attacker capture that code in transit - and wired the same code into an authorization routine it was never scoped for, which made it a master key. A secret is only as scoped as the narrowest code path that accepts it.

The second lesson is about things that look like secrets. A daily MD5 of hostname, date, and a constant string is a signature only in the sense that it has the right shape; when every input is knowable - one of them served on the TLS certificate itself - it authenticates nothing. And the third is a reminder that "requires user interaction" quietly stopped meaning "requires a human": the mail scanner between the server and the victim is a user too, and it clicks everything.

Update to 1.30.6. Keep 2304 off the internet. And grep your reset flow for HTTP_HOST.


Sources

  1. VulnCheck - "One Recovery Code, Two Shells in Control Web Panel" (primary disclosure, Nov 16, 2026): https://www.vulncheck.com/blog/control-web-panel-recovery-code-rce
  2. VulnCheck Advisory - CVE-2026-124020, Host Header Password Reset Poisoning: https://www.vulncheck.com/advisories/control-web-panel-host-header-password-reset-poisoning
  3. VulnCheck Advisory - CVE-2026-124021, Authorization Bypass via oauth_authorization_codes: https://www.vulncheck.com/advisories/control-web-panel-authorization-bypass-via-oauth-authorization-codes
  4. GitHub Advisory Database - GHSA-mgcx-hxxw-4q57 (CVE-2026-124021): https://github.com/advisories/GHSA-mgcx-hxxw-4q57
  5. pwned.coffee - "Validate: authentication bypass (CVE-2026-124021)": https://pwned.coffee/i/validate-authentication-bypass-cve-2026-124021
  6. LLCForge/CVE-2026-124020 - Python proof of concept: https://github.com/LLCForge/CVE-2026-124020
  7. Control Web Panel changelog (vendor): https://control-webpanel.com/changelog

Exposure figures are VulnCheck's and Shodan's as cited in the disclosure. Exploit timings are from VulnCheck's published module logs. No hands-on testing was performed for this article.

Top comments (0)