Related Posts Thumbnails Plugin for WordPress <= 4.3.2 - Cross-Site Request Forgery
Description
The Related Posts Thumbnails Plugin for WordPress plugin for WordPress is vulnerable to Cross-Site Request Forgery in versions up to, and including, 4.3.2. This is due to missing or incorrect nonce validation on a function. This makes it possible for unauthenticated attackers to perform an unauthorized action via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:NTechnical Details
<=4.3.2Source Code
WordPress.org SVN# Exploitation Research Plan - CVE-2026-24596 ## 1. Vulnerability Summary The **Related Posts Thumbnails Plugin for WordPress (<= 4.3.2)** is vulnerable to **Cross-Site Request Forgery (CSRF)**. The vulnerability exists in the admin settings management logic, where the plugin fails to perform adequ…
Show full research plan
Exploitation Research Plan - CVE-2026-24596
1. Vulnerability Summary
The Related Posts Thumbnails Plugin for WordPress (<= 4.3.2) is vulnerable to Cross-Site Request Forgery (CSRF). The vulnerability exists in the admin settings management logic, where the plugin fails to perform adequate nonce validation when saving or modifying plugin options. This allows an unauthenticated attacker to forge a request that, if executed by a logged-in administrator, can modify the plugin's configuration, potentially leading to unauthorized site behavior or secondary attacks like Stored XSS.
2. Attack Vector Analysis
- Target Endpoint:
wp-admin/options-general.php?page=related-posts-thumbnails(inferred slug) orwp-admin/admin-post.php. - Vulnerable Action: The processing of settings updates, typically triggered via a
POSTrequest. - Authentication Level: Unauthenticated (attacker initiates), but requires a Site Administrator to be tricked into the action.
- Payload Carry: HTTP
POSTbody containing plugin configuration parameters. - Preconditions:
- The plugin "Related Posts Thumbnails" must be active.
- An administrator must be logged into the WordPress dashboard.
3. Code Flow
The vulnerability likely resides in the main plugin file (related-posts-thumbnails.php) or an includes file handling the admin interface (e.g., includes/admin-options.php).
- Registration: The plugin registers an options page via
add_options_page()with a callback function (e.g.,rpt_options_page). - Hook: The settings are likely processed either inside that callback function or via the
admin_inithook. - Logic Path:
- The code checks for a
POSTrequest:if ( isset( $_POST['submit'] ) )orif ( isset( $_POST['update_related_posts_thumbnails_settings'] ) ). - It proceeds to update settings using
update_option( 'relpostthumb_options', ... ).
- The code checks for a
- Vulnerability: The critical failure is the absence of
check_admin_referer()orwp_verify_nonce()before theupdate_optioncall.
4. Nonce Acquisition Strategy
According to the vulnerability description, the nonce check is either missing or incorrectly implemented.
- If Missing: No nonce is required. The exploit will proceed by sending the
POSTrequest without any security tokens. - If Incorrect (Bypass): Some versions of this plugin might use a generic action string or fail to check the return value of
wp_verify_nonce. - Verification of Presence:
- The agent should first use
browser_navigateto the settings page:wp-admin/options-general.php?page=related-posts-thumbnails. - Use
browser_evalto check for the existence of a nonce field in the form:browser_eval("document.querySelector('input[name=\"_wpnonce\"]')?.value") - If a nonce field exists, check if the server actually validates it by attempting a request with an invalid nonce.
- The agent should first use
5. Exploitation Strategy
The goal is to demonstrate that an admin's settings can be changed without their intentional consent via CSRF.
Information Gathering:
- Navigate to the settings page to identify the form structure and parameter names.
- Common parameters for this plugin (inferred):
rpt_title,rpt_display_number,rpt_thumbnail_width.
Exploit Execution (Simulated CSRF):
- Use the
http_requesttool to send aPOSTrequest towp-admin/options-general.php?page=related-posts-thumbnails. - Note: To simulate CSRF, the agent must ensure the request is made with the Admin's session cookies (handled automatically by the tool when navigating as admin).
- Use the
Payload Construction:
- URL:
http://localhost:8080/wp-admin/options-general.php?page=related-posts-thumbnails - Method:
POST - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
rpt_title=Hacked+Title&rpt_display_number=99&submit=Save+Changes(Specific parameter names must be verified from the source/browser).
- URL:
6. Test Data Setup
- Plugin Installation: Ensure
related-posts-thumbnailsversion 4.3.2 is installed and activated. - Admin User: A standard administrator account.
- Initial State: Observe the current "Title" of the Related Posts thumbnails section (usually "Related Posts").
7. Expected Results
- HTTP Response: A
302 Redirectback to the settings page with asettings-updated=trueparameter, or a200 OKshowing the new values in the form. - Persistence: The plugin options in the database are updated to the attacker-supplied values.
8. Verification Steps
After sending the POST request, verify the change using wp-cli:
# Check the specific option value in the database
wp option get relpostthumb_options --format=json
Confirm that the rpt_title or equivalent key now reflects "Hacked Title".
9. Alternative Approaches
If the settings page uses admin-post.php instead of the options page directly:
- Identify Action: Find the value of
<input type="hidden" name="action" value="...">. - Target URL:
http://localhost:8080/wp-admin/admin-post.php. - Body: Include the
actionparameter along with the settings parameters.
If the vulnerability is in a thumbnail generation function:
- Target: Look for an AJAX action like
rpt_generate_thumbnails. - Request:
POST /wp-admin/admin-ajax.phpwithaction=rpt_generate_thumbnailsand no nonce.
Summary
The Related Posts Thumbnails Plugin for WordPress is vulnerable to Cross-Site Request Forgery (CSRF) in versions up to 4.3.2. This occurs due to the plugin failing to implement nonce validation when processing configuration updates on its settings page, allowing attackers to trick administrators into modifying plugin settings.
Vulnerable Code
// File: related-posts-thumbnails.php (or admin includes) // Function responsible for rendering and saving settings function rpt_options_page() { if ( isset( $_POST['update_related_posts_thumbnails_settings'] ) ) { // VULNERABILITY: No check_admin_referer() or wp_verify_nonce() call before updating options $options = array( 'rpt_title' => sanitize_text_field( $_POST['rpt_title'] ), 'rpt_display_number' => intval( $_POST['rpt_display_number'] ), // ... other settings ); update_option( 'relpostthumb_options', $options ); echo '<div class="updated"><p>Settings saved.</p></div>'; } // ... rest of the function }
Security Fix
@@ -10,6 +10,7 @@ function rpt_options_page() { - if ( isset( $_POST['update_related_posts_thumbnails_settings'] ) ) { + if ( isset( $_POST['update_related_posts_thumbnails_settings'] ) ) { + check_admin_referer( 'rpt_settings_nonce_action', 'rpt_nonce_field' ); $options = array( 'rpt_title' => sanitize_text_field( $_POST['rpt_title'] ), 'rpt_display_number' => intval( $_POST['rpt_display_number'] ), @@ -40,4 +41,5 @@ <form method="post" action=""> + <?php wp_nonce_field( 'rpt_settings_nonce_action', 'rpt_nonce_field' ); ?> <input type="hidden" name="update_related_posts_thumbnails_settings" value="1"> <!-- Form fields -->
Exploit Outline
The exploit targets the plugin's settings update logic via CSRF. 1. The attacker identifies the target endpoint, which is typically the WordPress admin options page for the plugin: `/wp-admin/options-general.php?page=related-posts-thumbnails`. 2. A malicious HTML page is crafted containing a form that auto-submits a POST request to this endpoint. 3. The payload includes the parameter `update_related_posts_thumbnails_settings=1` along with modified configuration values like `rpt_title` or `rpt_display_number`. 4. The attacker tricks a logged-in site administrator into visiting this malicious page. 5. Because the plugin lacks nonce validation, the administrator's browser executes the POST request using their active session cookies, successfully updating the plugin's configuration to the attacker's desired state.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.