Wholesale Suite <= 2.2.6 - Authenticated (Shop Manager) Privilege Escalation
Description
The Wholesale Suite – B2B, Dynamic Pricing & WooCommerce Wholesale Prices plugin for WordPress is vulnerable to Privilege Escalation in all versions up to, and including, 2.2.6.This makes it possible for authenticated attackers, with Shop Manager-level access and above, to elevate their privileges to that of an administrator.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:HTechnical Details
<=2.2.6What Changed in the Fix
Changes introduced in v2.2.7
Source Code
WordPress.org SVN# Research Plan: CVE-2026-27541 - Wholesale Suite Privilege Escalation ## 1. Vulnerability Summary The **Wholesale Suite (woocommerce-wholesale-prices)** plugin for WordPress (versions <= 2.2.6) contains a privilege escalation vulnerability. The core issue resides in the plugin's settings managemen…
Show full research plan
Research Plan: CVE-2026-27541 - Wholesale Suite Privilege Escalation
1. Vulnerability Summary
The Wholesale Suite (woocommerce-wholesale-prices) plugin for WordPress (versions <= 2.2.6) contains a privilege escalation vulnerability. The core issue resides in the plugin's settings management or role management functionality. It allows authenticated users with Shop Manager capabilities (who typically have manage_woocommerce) to perform administrative actions, specifically escalating their own role or modifying site-wide settings (like default_role) due to insufficient capability checks (checking for manage_woocommerce or edit_posts instead of manage_options) in AJAX or REST API handlers.
2. Attack Vector Analysis
- Endpoint:
wp-admin/admin-ajax.php(or potentially a REST API endpoint underwp-json/wholesale-suite/v1/). - Vulnerable Action: Likely
wwp_save_settings,wwp_ajax_save_settings, orwwhp_update_settings(inferred from plugin naming conventions). - Payload Parameter:
settingsor a specific option parameter likedefault_role. - Authentication: Authenticated, Shop Manager level or higher.
- Preconditions: The plugin must be active, and a Shop Manager account must be available.
3. Code Flow (Inferred)
- Entry Point: The plugin registers an AJAX handler using
add_action( 'wp_ajax_wwp_save_settings', ... )(or similar). - Authorization Check: The handler likely uses
current_user_can( 'manage_woocommerce' ). While Shop Managers have this, they should not be allowed to modify arbitrary site options or roles. - Nonce Verification: A nonce check is likely present (e.g.,
check_ajax_referer( 'wwp_settings_nonce', 'nonce' )), but this nonce is exposed to Shop Managers on the plugin's settings page. - Processing: The code iterates through the provided
settingsarray. - Sink: It calls
update_option()for each key-value pair without a whitelist of allowed options, or it improperly handles role assignments during user updates.
4. Nonce Acquisition Strategy
To obtain a valid nonce for the Shop Manager user:
- Identify Trigger: The plugin settings are typically located at
/wp-admin/admin.php?page=wwp-settings. - Access Page: Log in as the Shop Manager and navigate to the settings page.
- Extract Nonce: The nonce is likely localized in the page source via
wp_localize_script.- JS Variable: Based on the manifest and plugin history, check
window.wwp_settings_varsorwindow.wwp_bulk_actions_vars. - Key: Look for
nonceorwwp_settings_nonce.
- JS Variable: Based on the manifest and plugin history, check
- Command:
// Browser Eval browser_eval("window.wwp_settings_vars?.nonce || window.wwp_vars?.nonce")
5. Exploitation Strategy
The goal is to update the WordPress default_role to administrator and then trigger a registration, or directly update the current user's role if the endpoint supports it.
Step-by-Step Plan:
- Login: Authenticate as the Shop Manager user.
- Discover Action: Grep the plugin directory for the settings saving action:
grep -rn "wp_ajax_" . | grep "save" - Obtain Nonce: Navigate to the plugin settings page and extract the nonce using
browser_eval. - Execute Privilege Escalation:
- Method A: Update
default_role(if the handler allows arbitrary options):- Request:
POST /wp-admin/admin-ajax.php - Content-Type:
application/x-www-form-urlencoded - Body:
action=wwp_save_settings&nonce=[NONCE]&settings[default_role]=administrator(or similar structure).
- Request:
- Method B: Direct Role Update (if the handler supports user modification):
- Request:
POST /wp-admin/admin-ajax.php - Body:
action=wwp_update_user_role&nonce=[NONCE]&user_id=[CURRENT_ID]&role=administrator
- Request:
- Method A: Update
6. Test Data Setup
- Install Plugin: Wholesale Suite <= 2.2.6 and WooCommerce.
- Create User: A user with the
shop_managerrole. - Configure Plugin: Ensure the plugin is initialized so settings pages are accessible.
- Identify Settings Page: Confirm the slug (usually
wwp-settings).
7. Expected Results
- Response: A successful response (e.g.,
{"success": true}or1). - Effect: The WordPress option
default_roleis changed toadministrator, OR the Shop Manager user's role is directly changed toadministratorin thewp_users/wp_usermetatables.
8. Verification Steps
- Check Option via WP-CLI:
wp option get default_role(Should returnadministrator). - Check User Role via WP-CLI:
wp user get [USERNAME] --field=roles(Should returnadministrator). - UI Verification: Log in as the former Shop Manager and verify that the "Plugins" and "Settings" menus are now visible (indicating full Admin access).
9. Alternative Approaches
- REST API: If AJAX is well-protected, check for REST routes:
grep -rn "register_rest_route" .
Look for endpoints that update settings and check if thepermission_callbackonly checks formanage_woocommerce. - Insecure Deserialization: If the settings are saved as a serialized object, check if the plugin uses
unserialize()on the input before saving. - Wholesale Role Management: Specifically target the "Wholesale Roles" creation feature. If a Shop Manager can create a role with
administratorcapabilities, they can then assign it to themselves.- Action:
wwp_add_wholesale_role - Payload:
role_name=attacker_role&capabilities[administrator]=1
- Action:
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.