bBlocks – Essential Gutenberg Blocks & Patterns Collection <= 2.0.31 - Authenticated (Contributor+) Privilege Escalation
Description
The bBlocks – Essential Gutenberg Blocks & Patterns Collection plugin for WordPress is vulnerable to privilege escalation in all versions up to, and including, 2.0.31. This makes it possible for authenticated attackers, with Contributor-level access and above, to elevate their privileges to that of an administrator.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HTechnical Details
What Changed in the Fix
Changes introduced in v2.0.32
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-39579 (bBlocks Privilege Escalation) ## 1. Vulnerability Summary The **bBlocks – Essential Gutenberg Blocks & Patterns Collection** plugin (<= 2.0.31) contains an authenticated privilege escalation vulnerability. The flaw exists because settings-saving functio…
Show full research plan
Exploitation Research Plan: CVE-2026-39579 (bBlocks Privilege Escalation)
1. Vulnerability Summary
The bBlocks – Essential Gutenberg Blocks & Patterns Collection plugin (<= 2.0.31) contains an authenticated privilege escalation vulnerability. The flaw exists because settings-saving functionality (likely via AJAX or REST API) uses an incorrect capability check (e.g., edit_posts instead of manage_options). This allows users with Contributor roles or higher to modify arbitrary WordPress options. By updating the default_role to administrator and enabling users_can_register, an attacker can create a new admin account or potentially modify their own user meta to gain full administrative access.
2. Attack Vector Analysis
- Endpoint:
wp-admin/admin-ajax.php(most likely) or the WordPress REST API (/wp-json/). - Action/Route: Likely
b_blocks_save_settingsor a REST endpoint like/wp-json/b-blocks/v1/settings. - Payload Parameters:
action: The AJAX action string (e.g.,b_blocks_save_settings)._wpnonce/nonce: Security token.settings: An array or JSON object containing option keys and values.
- Vulnerable Parameters: Any parameter that maps directly to
update_option(). - Authentication: Authenticated as Contributor (requires
wp-login.phpsession).
3. Code Flow (Inferred)
- Entry Point: The plugin registers an AJAX handler or REST route for the admin dashboard (referenced in
build/admin-dashboard.js). - Capability Check: The handler performs a check using
current_user_can( 'edit_posts' ). Since Contributors can edit posts, they pass this check. - Input Processing: The handler takes a list of settings from
$_POSTor the REST body. - Sink: The handler iterates through the input and calls
update_option( $key, $value )without a whitelist, or with a whitelist that includes sensitive WordPress core options.
4. Nonce Acquisition Strategy
The admin dashboard logic is contained in build/admin-dashboard.js. The nonce is likely localized using wp_localize_script in a PHP file (e.g., includes/admin/class-admin.php or the main plugin file).
- Identify Shortcode/Page: Check the main plugin PHP for
add_menu_pageoradd_shortcode. Gutenberg plugins often enqueue settings nonces on the block editor screen or a custom dashboard page. - Contributor Access: Navigate to a page accessible by a Contributor (e.g.,
/wp-admin/post-new.phpor the plugin's dashboard if allowed). - Extraction:
- The JS localization key is likely
bBlocksAdminDataorbBlocksSettings. - Use
browser_evalto extract the nonce:// Example targets to check window.bBlocksAdminData?.nonce window.bBlocksSettings?.nonce window.bBlocksData?.nonce
- The JS localization key is likely
- Action Check: Verify if the nonce action in
wp_create_noncematches the action incheck_ajax_refererorwp_verify_nonce.
5. Exploitation Strategy
Step 1: Discover the Endpoint
Grep the plugin directory for the following:
grep -r "wp_ajax_b_blocks" .grep -r "register_rest_route" .grep -r "update_option" .
Step 2: Prepare Payload
The goal is to modify core WordPress settings.
Target Options:
default_role->administratorusers_can_register->1
Sample AJAX Request:
POST /wp-admin/admin-ajax.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
action=b_blocks_save_settings&nonce=[EXTRACTED_NONCE]&settings[default_role]=administrator&settings[users_can_register]=1
Step 3: Execute Registration
Once the options are changed, navigate to /wp-login.php?action=register to create a new account, which will now default to the Administrator role.
6. Test Data Setup
- Install WordPress with the
b-blocksplugin (version <= 2.0.31). - Create a user with the Contributor role.
- Verify current settings:
wp option get default_role(should besubscriber) andwp option get users_can_register(should be0).
7. Expected Results
- The server returns a
200 OKor{"success":true}. - The
default_roleoption in the database is updated toadministrator. - The
users_can_registeroption is updated to1.
8. Verification Steps
- Check Options via CLI:
wp option get default_role wp option get users_can_register - Check User Escalation (Alternative): If the payload allowed targeting
wp_capabilitiesfor a specific user ID, check the role of the contributor:wp user get [CONTRIBUTOR_ID] --field=roles
9. Alternative Approaches
- Direct Meta Update: If the vulnerable function uses
update_user_metainstead ofupdate_option, target the Contributor's user ID to change theirwp_capabilitiestoa:1:{s:13:"administrator";b:1;}. - REST API Route: If the plugin uses REST, the request would be:
(CheckPOST /wp-json/b-blocks/v1/settings HTTP/1.1 Content-Type: application/json X-WP-Nonce: [EXTRACTED_NONCE] { "default_role": "administrator", "users_can_register": 1 }register_rest_routecalls to confirm the exact path and parameter structure.)
Summary
The bBlocks plugin (<= 2.0.31) incorrectly uses the 'edit_posts' capability for its settings-saving functionality rather than the 'manage_options' capability. This allows authenticated users with Contributor-level permissions or higher to modify arbitrary WordPress options, including sensitive core settings.
Security Fix
@@ -1 +1 @@ -<?php return array('dependencies' => array('react', 'react-dom', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n'), 'version' => '98328efe16bcd91feec8'); +<?php return array('dependencies' => array('react', 'react-dom', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-i18n'), 'version' => 'ef0b16b7bbdff4475bfc'); ... (truncated)
Exploit Outline
1. Authentication: Log in as a user with at least Contributor-level privileges. 2. Nonce Acquisition: Access the plugin dashboard or a post editing page to extract the security nonce from the localized JavaScript data (e.g., window.bBlocksAdminData.nonce). 3. Payload Preparation: Construct a POST request targeting the settings-saving endpoint (either wp-admin/admin-ajax.php with the action 'b_blocks_save_settings' or the plugin's REST API endpoint). 4. Privilege Escalation: Include parameters in the request to update sensitive WordPress options, such as setting 'default_role' to 'administrator' and 'users_can_register' to '1'. 5. Execution: Submit the request. Because the server improperly validates the user's capability as 'edit_posts', the request is authorized. 6. Verification: Navigate to the registration page to create a new administrator account or observe the elevation of the default role.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.