SECURITY ADVISORY / 01

CVE-2024-3246 Exploit & Vulnerability Analysis

Complete CVE-2024-3246 security advisory with proof of concept (PoC), exploit details, and patch analysis for litespeed-cache.

litespeed-cache products NVD ↗
Exploit PoC Vulnerability Patch Analysis

The Exploit

An unauthenticated attacker can forge a request that redirects a logged-in WordPress admin to a malicious external site while injecting a weaponized token parameter. The attacker needs no prior access — only the ability to trick an admin into clicking a link.

GET /wp-admin/admin.php?page=litespeed-cdn&token=<MALICIOUS_PAYLOAD>&nonce=ATTACKER_FORGED HTTP/1.1
Host: target-wordpress.local

When an admin clicks this link while logged in, the vulnerable plugin code in cdn-setup.cls.php processes the token parameter directly from $_GET without validating a WordPress nonce. The attacker observes a redirect to the LiteSpeed Cloud dashboard with their malicious token embedded in the query string. On the Cloud backend, if the token validation is insufficient, the attacker can inject arbitrary JavaScript or modify site configuration settings tied to that token.

Why this still matters at admin: Admins are routinely compromised through phishing, session theft via malware, or social engineering. A multi-tenant WordPress hosting environment where a restricted "CDN Manager" role exists is particularly vulnerable — that lower-privileged account could be compromised and used to inject tokens that affect the entire site's cache configuration.


What the Patch Did

Before:

$data = array(
    'site_url' => home_url(),
    'ref' => get_admin_url(null, 'admin.php?page=litespeed-cdn'),
);
$api_key = $this->conf(self::O_API_KEY);
if ($api_key) {
    $data['domain_hash'] = md5(substr($api_key, 0, 8));
}

wp_redirect(Cloud::CLOUD_SERVER_DASH . '/u/wptoken?data=' . Utility::arr2str($data));
exit();

After:

$data = array(
    'site_url' => home_url(),
    'ref' => get_admin_url(null, 'admin.php?page=litespeed-cdn'),
    'nonce' => wp_create_nonce('litespeed_qc_link'),
);
$api_key = $this->conf(self::O_API_KEY);
if ($api_key) {
    $data['domain_hash'] = md5(substr($api_key, 0, 8));
}
self::debug2('qc link created', $data);
wp_redirect(Cloud::CLOUD_SERVER_DASH . '/u/wptoken?data=' . Utility::arr2str($data));
exit();

The patch adds wp_create_nonce('litespeed_qc_link') to the redirect payload. On the receiving end in cloud.cls.php, the patch introduces wp_verify_nonce($_GET['nonce'], 'litespeed_qc_link') to cryptographically validate that the nonce matches the admin's session. Without a valid nonce, the request is rejected with an error message. Additionally, the token parameter is sanitized using preg_replace('/[^0-9a-zA-Z]/', '') to whitelist only alphanumeric characters, blocking injection attacks.


Root Cause

CWE-352: Cross-Site Request Forgery (CSRF) combined with CWE-20: Improper Input Validation.

The dataflow is straightforward: an attacker crafts a GET request with a forged token parameter. This parameter enters via $_GET['token'] in cloud.cls.php at line ~1440. The vulnerable code reads it directly into $_GET['token'] without validating a nonce or checking that the request originated from the WordPress admin. The token value is then passed to the Cloud dashboard without cryptographic proof that a legitimate admin authorized the request. The trust boundary crossed is the request origin — the code assumes any request carrying the token parameter must have been issued by the admin, when in reality an attacker can forge that request via a crafted link or form submission.


Why It Works

The load-bearing line is wp_verify_nonce($_GET['nonce'], 'litespeed_qc_link'). Remove it, and an attacker can forge a valid request with any token they choose — the CSRF vulnerability persists.

The engineer added wp_create_nonce() on the redirect source (cdn-setup.cls.php) to generate a cryptographically unique, time-bound token bound to the admin's session. This nonce is then included in the Cloud redirect URL. When the request returns from the Cloud backend, wp_verify_nonce() verifies that the nonce matches the current admin session and was created within the valid time window (WordPress nonces are valid for 24 hours by default, or 12 hours for administrative actions). The additional preg_replace() sanitization is defense-in-depth — it prevents an attacker from embedding special characters or injection payloads in the token field even if the nonce check were somehow bypassed.


Hardening Checklist

  • Implement wp_verify_nonce() for all sensitive state-changing operations that accept GET/POST parameters. Generate nonces using wp_create_nonce() with a unique action string (e.g., 'litespeed_qc_link'), include them in the form or redirect, and verify them on the handler side.

  • Whitelist and validate all external redirect targets using wp_safe_remote_request() or a whitelist of allowed external domains. Do not redirect to user-controlled URLs without validation.

  • Sanitize all user input with context-aware filters: use preg_replace('/[^0-9a-zA-Z]/', '') for tokens, sanitize_key() for object keys, and esc_url() for URLs before output.

  • Audit redirect chains and cross-domain requests in POST-request handlers. If your plugin redirects to an external service, ensure both the outbound link and any return callback include CSRF tokens.

  • Use WordPress capability checks (current_user_can('manage_options')) before processing sensitive parameters, even if a nonce is present. This prevents exploitation via compromised low-privilege admin accounts.


References

  • https://nvd.nist.gov/vuln/detail/CVE-2024-3246

Frequently asked questions about CVE-2024-3246

What is CVE-2024-3246?

CVE-2024-3246 is a security vulnerability identified in litespeed-cache. This security advisory provides detailed technical analysis of the vulnerability, exploit methodology, affected versions, and complete remediation guidance.

Is there a PoC (proof of concept) for CVE-2024-3246?

Yes. This writeup includes proof-of-concept details and a technical exploit breakdown for CVE-2024-3246. Review the analysis sections above for the PoC walkthrough and code examples.

How does CVE-2024-3246 get exploited?

The technical analysis section explains the vulnerability mechanics, attack vectors, and exploitation methodology affecting litespeed-cache. PatchLeaks publishes this information for defensive and educational purposes.

What products and versions are affected by CVE-2024-3246?

CVE-2024-3246 affects litespeed-cache. Check the affected-versions section of this advisory for specific version ranges, vulnerable configurations, and compatibility information.

How do I fix or patch CVE-2024-3246?

The patch analysis section provides guidance on updating to patched versions, applying workarounds, and implementing compensating controls for litespeed-cache.

What is the CVSS score for CVE-2024-3246?

The severity rating and CVSS scoring for CVE-2024-3246 affecting litespeed-cache is documented in the vulnerability details section. Refer to the NVD entry for the current authoritative score.