Start a Project

Exploits & Mitigations for WordPress LiteSpeed Cache V-6.4.1

A researcher has discovered a critical vulnerability in LiteSpeed Cache, a popular plugin used by over 6 million WordPress sites to improve load times.

This flaw, CVE-2024-44000, allows attackers to gain control of a WordPress site without requiring authentication of the identity.

In our previous blog, we discussed how we can identify and fix the Vulnerabilities in LiteSpeed Cache version 6.3.0.1.

We identified another vulnerability in version 6.4.1 of the plugin: “Unauthenticated Sensitive Information Exposure via Log Files.” This flaw allows an attacker to completely take over an account.

Unauthenticated Sensitive Information Exposure

It is a security vulnerability where sensitive data is unintentionally accessible to individuals without any authentication or credentials.

This flaw occurs when the system exposes private information, like login credentials, session cookies, personal data, or system details, to anyone without requiring a login.

Improper Access Control

Improper access control or system misconfiguration may make sensitive information like debugging logs, configuration files, or internal error messages publicly accessible.

Exposed Debugging Information

Developers sometimes leave debugging enabled in production environments, which can expose information like session tokens, usernames, paths, or API keys in logs or error messages.

Attackers can exploit this by reading these logs and using the sensitive data to gain unauthorized access or perform attacks (e.g., session hijacking)

No Authentication Required

The main feature of this vulnerability is that an attacker can exploit it without logging in or submitting credentials. The system exposes sensitive data without verification of identification.

Identifying Vulnerability In LiteSpeed Cache V-6.4.1

All versions of LiteSpeed up to 6.4.1 expose sensitive information via the publicly accessible debug.log file, allowing unauthenticated attackers to access user session data and potentially log in.

WordPress stores sensitive session cookies in log files for troubleshooting, potentially exposing logged-in users, including admins.

The vulnerability occurs when the debug.log file is publicly accessible due to misconfigurations and debug mode is enabled, though it should be off by default in WordPress.

Identifying a publicly accessible debug.log file on the target website.

Accessing the file directly via its URL (e.g., http://yourwebsite.com/folder-name/debug.log).

If a hacker gains access to this log file, they can steal the session cookies, impersonate an administrator, and take full control of the site.

Steps to Exploit this Vulnerability In LiteSpeed Cache V-6.4.1

For a better understanding of this attack, please refer to the diagram.

By following these steps, you can reproduce this vulnerability on your website

1. Activate Debug Mode:-

In the WordPress root directory, open the wp-config.php file.

Enable (‘WP_DEBUG’ , true );(‘WP_DEBUG_LOG’, true );

Add the following lines to enable logging and make sure to prevent the errors from being displayed on the site:

2. Trigger Logs:

Perform any activity on your WordPress site to populate the log with entries.

You can perform any action such as: Logging in with different users and Performing administrative tasks. The admin can perform actions like adding, editing, or deleting products.

They can also create a new user account, log in with that account, add products to the cart, interact with the site, perform similar activities, etc.

These activities will cause session cookies and user information to be written to the debug.log file.

3. Access the debug.log File:

If the debug.log file is publicly accessible, the attacker can directly access it by navigating to the following URL:
http://yourwebsite.com/folder-name/debug.log

The log file will load in the browser, revealing sensitive data such as session cookies.

4. Analyze the Log File:-

Look for session-related cookies, typically starting with wordpress_logged_in_, or other authentication tokens. These cookies can be used to hijack user sessions.

Exploitation

Copy the session cookie of a logged-in user (e.g., an administrator) from the debug.log file.

Use a browser extension like Edit This Cookie to replace your browser’s session cookie with the one from the log file.

Refresh the WordPress admin page, and you will be logged in as the user whose session was exposed, potentially gaining admin access.

As shown in below snapshot;

Add Cookies Editor extension using this link or go to your Browser store:-

For Chrome:-

https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm?hl=en&pli=1

For Firefox:-

https://addons.mozilla.org/en-US/firefox/addon/cookie-editor/

Impact on Your Website

Prevention for this Vulnerability

(update Version 6.4.1 to 6.5.0.1 or higher version)

Conclusion:

The LiteSpeed Cache 6.4.1 vulnerability exposes session cookies through a public debug.log file, allowing attackers to hijack sessions and gain unauthorized admin access.

This risk only occurs when debug mode is enabled, which is off by default.

However, if left unaddressed, it can lead to serious consequences, including website takeover, data breaches, and reputational damage.

Preventing this vulnerability requires securing or disabling the debug.log file, ensuring the debug mode is off in production, and following best practices for WordPress security.

Need Support?

Thank You for reading this Blog!

For further more interesting blogs, keep in touch with us. If you need any kind of support, simply raise a ticket at https://webkul.uvdesk.com/en/.

For further help or queries, please contact us or raise a ticket.

Exit mobile version