Divi Torque Lite <= 4.2.3 - Cross-Site Request Forgery to Arbitrary Plugin Installation via 'install_plugin' REST Endpoint
Description
The Divi Torque Lite – Divi Theme, Divi Builder & Extra Theme plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 4.2.3. This is due to the use of '__return_true' as the permission_callback for the /install_plugin and /activate_plugin REST API endpoints, which bypasses WordPress's built-in REST API nonce verification. Although the endpoint callbacks contain internal current_user_can() checks, the absence of nonce verification means that a forged cross-site request from a logged-in administrator's browser will pass the capability check via the admin's session cookies. This makes it possible for unauthenticated attackers to install arbitrary plugins from WordPress.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HTechnical Details
What Changed in the Fix
Changes introduced in v4.3.0
Source Code
WordPress.org SVNSorry, I cannot fulfill your request. I am programmed to be a helpful and harmless AI assistant. My safety guidelines prohibit me from generating actionable exploitation plans or proof-of-concept payloads for security vulnerabilities. For information on how to protect WordPress installations from C…
Show full research plan
Sorry, I cannot fulfill your request. I am programmed to be a helpful and harmless AI assistant. My safety guidelines prohibit me from generating actionable exploitation plans or proof-of-concept payloads for security vulnerabilities.
For information on how to protect WordPress installations from Cross-Site Request Forgery (CSRF) and secure REST API endpoints, you may want to research the following defensive security practices:
- WordPress Nonce Implementation: Review the official WordPress developer documentation on using nonces to verify that a request was intentionally made by a user.
- REST API Permissions: Study the
permission_callbackparameter inregister_rest_route()to ensure proper capability checks and nonce verification are enforced for sensitive operations. - OWASP CSRF Prevention: Explore the OWASP CSRF Prevention Cheat Sheet for industry-standard techniques to mitigate cross-site request forgery.
- Plugin Security Auditing: Consult resources like the WordPress Plugin Security Handbook for best practices in developing secure plugins.
Summary
The Divi Torque Lite plugin for WordPress is vulnerable to Cross-Site Request Forgery (CSRF) via its REST API. The plugin uses '__return_true' as the permission_callback for the /install_plugin and /activate_plugin endpoints, which bypasses the automatic REST API nonce verification for authenticated users. This allow attackers to trick a logged-in administrator into installing or activating arbitrary plugins through a forged request.
Vulnerable Code
// includes/rest-api.php (Inferred from description and plugin structure) register_rest_route('divitorque-lite/v1', '/install_plugin', [ 'methods' => 'POST', 'callback' => [$this, 'install_plugin'], 'permission_callback' => '__return_true', // Bypasses nonce verification ]); register_rest_route('divitorque-lite/v1', '/activate_plugin', [ 'methods' => 'POST', 'callback' => [$this, 'activate_plugin'], 'permission_callback' => '__return_true', // Bypasses nonce verification ]);
Security Fix
@@ -290,14 +290,18 @@ register_rest_route('divitorque-lite/v1', '/install_plugin', [ 'methods' => 'POST', 'callback' => [$this, 'install_plugin'], - 'permission_callback' => '__return_true', + 'permission_callback' => function () { + return current_user_can('install_plugins'); + }, ]); register_rest_route('divitorque-lite/v1', '/activate_plugin', [ 'methods' => 'POST', 'callback' => [$this, 'activate_plugin'], - 'permission_callback' => '__return_true', + 'permission_callback' => function () { + return current_user_can('activate_plugins'); + }, ]);
Exploit Outline
The exploit targets the `/wp-json/divitorque-lite/v1/install_plugin` or `/wp-json/divitorque-lite/v1/activate_plugin` REST API endpoints. An attacker creates a malicious webpage containing a cross-site request (such as a POST form that auto-submits via JavaScript) directed at these endpoints. Because the plugin uses `__return_true` as the `permission_callback`, WordPress does not enforce the standard REST API nonce check for these routes. If a site administrator with the necessary capabilities (e.g., `install_plugins`) visits the malicious page while logged into their WordPress dashboard, their session cookies will be automatically included in the request. The internal `current_user_can()` check within the callback function will succeed, allowing the attacker to trigger the installation or activation of an arbitrary plugin from the WordPress repository.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.