WebP Conversion <= 2.1 - Missing Authorization
Description
The WebP Conversion plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in versions up to, and including, 2.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.1This research plan focuses on identifying and exploiting a missing authorization vulnerability in the **WebP Conversion** plugin (versions <= 2.1). ### 1. Vulnerability Summary The "WebP Conversion" plugin fails to implement proper authorization checks (e.g., `current_user_can()`) or CSRF protectio…
Show full research plan
This research plan focuses on identifying and exploiting a missing authorization vulnerability in the WebP Conversion plugin (versions <= 2.1).
1. Vulnerability Summary
The "WebP Conversion" plugin fails to implement proper authorization checks (e.g., current_user_can()) or CSRF protection (nonces) on its AJAX or administrative handlers. This allows unauthenticated attackers to trigger sensitive plugin actions, such as modifying settings or initiating image conversion processes, which can impact site integrity (I:L).
2. Attack Vector Analysis
- Endpoint:
POST /wp-admin/admin-ajax.phporPOST /wp-admin/admin-post.php. - Target Actions: Likely
webp_conversion_save_settings,webp_conversion_manual, orwebp_conversion_bulk. (Exact action names to be verified). - Payload: URL-encoded POST parameters representing plugin settings or conversion triggers.
- Authentication: Unauthenticated (PR:N).
- Preconditions: The plugin must be active.
3. Code Flow (Inferred)
- Entry Point: The plugin registers AJAX handlers using
add_action('wp_ajax_nopriv_...', ...)or hooks intoadmin_init/initto handle global POST requests. - Handler Execution: A function (e.g.,
webp_conversion_save_settings_callback) is executed. - Missing Check: The handler fails to call
current_user_can('manage_options'). - Action Execution: The code directly updates the database via
update_option()or interacts with the filesystem without verifying the requester's identity.
4. Nonce Acquisition Strategy
If the plugin requires a nonce but exposes it to unauthenticated users via wp_localize_script:
- Discovery: Search the codebase for
wp_create_nonce.- Command:
grep -r "wp_create_nonce" /var/www/html/wp-content/plugins/webp-conversion/
- Command:
- Localization Variable: Identify the JS object and key.
- Example:
wp_localize_script( 'webp-script', 'webp_obj', array( 'nonce' => wp_create_nonce('webp_nonce') ) );
- Example:
- Extraction:
- Identify which shortcode or page triggers the script (e.g., the plugin's settings page or a public page where conversion is mentioned).
- Use
browser_navigateto a page where the script is enqueued. - Use
browser_eval("window.webp_obj?.nonce")(inferred variable name) to extract the token.
- Bypass: If the plugin lacks
check_ajax_refererorwp_verify_nonceentirely, no nonce is needed.
5. Exploitation Strategy
Phase 1: Discovery
First, the agent must identify the exact AJAX actions:
- Search for
wp_ajax_nopriv_:grep -rn "wp_ajax_nopriv_" /var/www/html/wp-content/plugins/webp-conversion/ - Search for functions that update options without capability checks:
grep -rn "update_option" /var/www/html/wp-content/plugins/webp-conversion/ -B 10
Phase 2: Exploitation (Assuming webp_conversion_save_settings is vulnerable)
- URL:
http://localhost:8080/wp-admin/admin-ajax.php - Method:
POST - Content-Type:
application/x-www-form-urlencoded - Parameters:
action:webp_conversion_save_settings(inferred)webp_quality:1(Setting quality to minimum to degrade site appearance)webp_method:cwebp(inferred)_wpnonce: (Only if found during discovery)
Example Payload:
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
action=webp_conversion_save_settings&webp_quality=1&webp_active=0
6. Test Data Setup
- Install Plugin: Ensure
webp-conversionv2.1 is installed and active. - Configuration: Configure the plugin with default settings (Quality: 80, Active: 1).
- Content: Create at least one post with an image to verify if settings changes affect conversion behavior later.
7. Expected Results
- HTTP Response:
200 OKor a JSON success message (e.g.,{"success":true}). - Database State: The
webp_conversion_quality(or similar) option in thewp_optionstable should be updated to the attacker-supplied value. - Unauthorized Action: An unauthenticated user successfully modifies site-wide plugin configurations.
8. Verification Steps
After the exploit, verify via WP-CLI:
- Check the relevant option:
wp option get webp_conversion_quality(Verify it is now1) - Check the status:
wp option get webp_conversion_active(Verify if it was toggled) - Compare the current value with the initial value to confirm the change.
9. Alternative Approaches
- Admin-post.php: If no AJAX actions are found, check for
admin_post_nopriv_actions. - Direct Hook: Check
initoradmin_inithooks that check for specific$_POSTkeys:grep -rn "add_action.*init" /var/www/html/wp-content/plugins/webp-conversion/ -A 5 | grep "_POST" - Bulk Conversion: If setting manipulation is not possible, try to trigger the bulk conversion process repeatedly to cause resource exhaustion (Denial of Service/Integrity impact).
- Action:
webp_conversion_bulk_start(inferred).
- Action:
Summary
The WebP Conversion plugin for WordPress is vulnerable to unauthorized modification of settings and execution of plugin actions due to missing capability checks and nonce verification on AJAX handlers. This allows unauthenticated attackers to change image conversion parameters or trigger conversion processes, potentially impacting site performance and integrity.
Exploit Outline
1. Identify the AJAX action used for saving settings or triggering conversions (such as `webp_conversion_save_settings`), which is registered via `wp_ajax_nopriv_` or `wp_ajax_` hooks. 2. Construct a POST request targeting the WordPress AJAX endpoint at `/wp-admin/admin-ajax.php`. 3. Include the target `action` parameter and the desired configuration values in the payload (e.g., setting `webp_quality` to '1' or toggling plugin features). 4. Send the request without any authentication or CSRF tokens; because the plugin handler lacks `current_user_can()` and `check_ajax_referer()` or `wp_verify_nonce()` calls, the malicious configuration will be saved to the database.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.