Book Previewer for Woocommerce <= 1.0.6 - Missing Authorization
Description
The Book Previewer for Woocommerce plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in versions up to, and including, 1.0.6. 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
<=1.0.6This research plan targets **CVE-2026-39668**, a missing authorization vulnerability in the **Book Previewer for Woocommerce** plugin. Since the plugin allows unauthenticated attackers to perform unauthorized actions, our goal is to identify the specific AJAX or REST endpoint that lacks a `current_u…
Show full research plan
This research plan targets CVE-2026-39668, a missing authorization vulnerability in the Book Previewer for Woocommerce plugin. Since the plugin allows unauthenticated attackers to perform unauthorized actions, our goal is to identify the specific AJAX or REST endpoint that lacks a current_user_can() check and exploit it to modify plugin settings or site data.
1. Vulnerability Summary
- Vulnerability: Missing Authorization (Insecure Direct Object Reference or unprotected AJAX handler).
- Location: Likely within an AJAX handler registered via
wp_ajax_nopriv_or anadmin_inithook that processes$_POSTwithout checking capabilities. - Affected Functionality: Modification of plugin settings, product metadata related to book previews, or administrative configurations.
- Why it exists: The developer registered a function to handle sensitive data updates but omitted
if (!current_user_can('manage_options'))(or a similar capability check), allowing any user (including unauthenticated ones) to trigger the function.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action (Inferred): Likely prefixed with
bpw_orbook_previewer_, such asbpw_save_settings,bpw_update_options, orsave_book_preview_data. - Authentication: None required (AV:N / PR:N).
- Preconditions: The plugin must be active. A valid nonce may be required if
check_ajax_refereris used, even if authorization is missing.
3. Code Flow (Inferred)
- Entry Point:
admin-ajax.phpreceives a POST request with anactionparameter. - Hook Trigger: WordPress triggers the
wp_ajax_nopriv_{action}hook. - Vulnerable Handler: The plugin's callback function (e.g.,
BPW_Ajax::save_settingsor a similar name) is executed. - Authorization Failure: The handler function processes input (e.g.,
update_optionorupdate_post_meta) without callingcurrent_user_can(). - Data Modification: The attacker's payload is written to the database.
4. Nonce Acquisition Strategy
If the vulnerable handler uses check_ajax_referer('some_action', 'nonce_key'), we must find where that nonce is generated and exposed.
- Identify Shortcode: Search for shortcodes that might load plugin assets:
grep -rn "add_shortcode" . - Create Test Page:
wp post create --post_type=page --post_status=publish --post_title="Preview Test" --post_content='[book_previewer_shortcode_found]'(Replace with the actual shortcode). - Find the Nonce in JS:
Plugins usually localize nonces. Search forwp_localize_scriptin the codebase:grep -rn "wp_localize_script" .
Note the JS object and key (e.g.,bpw_ajax_obj.nonce). - Extract via Browser:
Usebrowser_navigateto the created page, then:browser_eval("window.bpw_ajax_obj?.nonce || window.book_previewer_params?.nonce")
5. Exploitation Strategy
The target is likely a setting that can cause visible changes or compromise site integrity (e.g., changing the preview URL or disabling purchase buttons).
Step 1: Discovery (To be performed by the agent)
- Run:
grep -r "wp_ajax_nopriv_" .to find all unauthenticated AJAX entry points. - Identify the callback function for those actions.
- Inspect the callback for the absence of
current_user_can.
Step 2: Crafting the Payload
Assuming a hypothetical action bpw_save_settings that updates a plugin option:
- URL:
http://<target>/wp-admin/admin-ajax.php - Method: POST
- Headers:
Content-Type: application/x-www-form-urlencoded - Body Parameters:
action:bpw_save_settings(as found in Discovery)securityor_wpnonce: (Extracted from Step 4)payload_key:malicious_value(e.g., setting a PDF preview URL to an external phishing site or changing a price-related setting).
Step 3: Execution
Use the http_request tool to send the POST request.
6. Test Data Setup
- Install Plugin: Ensure
book-previewer-for-woocommerceversion 1.0.6 is installed. - Create Product: Create a WooCommerce product to test preview settings.
wp eval "$p = ['post_title' => 'Test Book', 'post_type' => 'product', 'post_status' => 'publish']; wp_insert_post($p);" - Identify Settings: Look at the plugin's admin page to see which options it manages (e.g.,
bpw_preview_settings).
7. Expected Results
- Success Response: The server returns a
200 OKor{"success":true}response. - Impact: A site option or product meta field is updated with the attacker's value, proving unauthorized modification.
8. Verification Steps
After the HTTP request, verify the change via WP-CLI:
- Check Options:
wp option get bpw_settings(Replace with the actual option name found). - Check Meta:
wp post meta list <product_id>if the exploit targeted product-specific preview data.
9. Alternative Approaches
- REST API: If no AJAX handlers are found, search for
register_rest_route. Check if any routes have'permission_callback' => '__return_true'or missing the callback entirely. - Admin Init Hook: Check for
add_action('admin_init', ...)functions that don't checkis_admin()properly. Note:admin-ajax.phptriggersadmin_init, so unauthenticated users can often hit these hooks by callingadmin-ajax.phpwith any valid action. - Settings Save: If the plugin uses the standard Settings API, check if
register_settingwas used without proper sanitization or if the options page can be submitted by non-admins.
Summary
The Book Previewer for Woocommerce plugin for WordPress (versions up to 1.0.6) is vulnerable to unauthorized data modification due to missing capability checks on functions handling sensitive data. This allows unauthenticated attackers to perform unauthorized actions, such as modifying plugin settings or product-related preview metadata, by interacting with the plugin's AJAX handlers.
Exploit Outline
An attacker targets the WordPress AJAX endpoint at /wp-admin/admin-ajax.php. By identifying an AJAX action registered via wp_ajax_nopriv_ (intended for unauthenticated users) that maps to a function lacking a current_user_can() check, the attacker can send a POST request with a crafted payload to modify site options or post metadata. If the function requires a nonce, the attacker first extracts it from the localized JavaScript variables (e.g., bpw_ajax_obj.nonce) often found on the product or preview pages where the plugin is active.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.