Seraphinite Accelerator <= 2.28.14 - Missing Authorization to Authenticated (Subscriber+) Log Clearing
Description
The Seraphinite Accelerator plugin for WordPress is vulnerable to unauthorized modification of data due to a missing capability check on the `seraph_accel_api` AJAX action with `fn=LogClear` in all versions up to, and including, 2.28.14. This makes it possible for authenticated attackers, with Subscriber-level access and above, to clear the plugin's debug/operational logs.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:NTechnical Details
<=2.28.14What Changed in the Fix
Changes introduced in v2.28.15
Source Code
WordPress.org SVNThis research plan focuses on exploiting CVE-2026-3056, a missing authorization vulnerability in the Seraphinite Accelerator plugin that allows Subscriber-level users to clear the plugin's debug and operational logs. ### 1. Vulnerability Summary The Seraphinite Accelerator plugin registers an AJAX …
Show full research plan
This research plan focuses on exploiting CVE-2026-3056, a missing authorization vulnerability in the Seraphinite Accelerator plugin that allows Subscriber-level users to clear the plugin's debug and operational logs.
1. Vulnerability Summary
The Seraphinite Accelerator plugin registers an AJAX action seraph_accel_api intended for administrative tasks. While it implements nonce verification to prevent CSRF, it fails to perform a capability check (e.g., current_user_can('manage_options')) within the handler when the fn parameter is set to LogClear. Consequently, any authenticated user with access to the WordPress admin dashboard (including Subscribers) can trigger this action.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
seraph_accel_api - Parameters:
action:seraph_accel_api(Required)fn:LogClear(The specific function to execute)_wpnonce: A valid WordPress nonce for the API (Required)
- Authentication: Authenticated (Subscriber-level or higher)
- Preconditions: The plugin must be active. Logs should ideally contain data to demonstrate "clearing."
3. Code Flow
- Entry Point: The request hits
admin-ajax.phpwithaction=seraph_accel_api. - Hook Registration: The plugin registers
add_action('wp_ajax_seraph_accel_api', ...)(Inferred from standard WordPress AJAX patterns and the CVE description). - Handler Execution: The handler function (likely within the
seraph_accel\Pluginor a dedicated controller class) is called. - Nonce Check: The code likely calls
check_ajax_referer('seraph_accel_api', '_wpnonce')orwp_verify_nonce. - Missing Check: The code proceeds to process
$_REQUEST['fn']without callingcurrent_user_can(). - Function Dispatch: When
fn == 'LogClear', the plugin executes the log clearing logic, which typically involves deleting or truncating the log file or clearing a database option. - Sink: The filesystem (via
@unlinkorfile_put_contents) or the database (viadelete_option).
4. Nonce Acquisition Strategy
The plugin enqueues its administrative scripts and nonces via the admin_notices hook in main.php.
- Hook:
_OnAdminNoticescallsPlugin::_admin_printscriptsstyles(). - Location: This runs on all
/wp-admin/pages, including the Dashboard and Profile pages accessible to Subscribers. - JS Variable: The plugin typically localizes its data into a global JavaScript object. Based on the naming conventions in
main.php, the variable is likelyseraph_accel_adminorseraph_accel.
Acquisition Steps:
- Log in as a Subscriber user.
- Navigate to
/wp-admin/profile.php. - Execute
browser_evalto extract the nonce:browser_eval("window.seraph_accel_admin?.nonce || window.seraph_accel?.nonce")
Note: If the key isn't 'nonce', inspect the object keys for anything resembling a 10-character alphanumeric string.
5. Exploitation Strategy
- Authentication: Authenticate the automated agent as a Subscriber.
- Nonce Retrieval: Use the strategy in Section 4 to obtain the nonce.
- Exploit Request: Send a POST request to
admin-ajax.php.- URL:
http://localhost:8080/wp-admin/admin-ajax.php - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
action=seraph_accel_api&fn=LogClear&_wpnonce=[EXTRACTED_NONCE]
- URL:
- Verification: Check the response. A successful response from this plugin's API usually returns a JSON object or a success code (like
0forS_OKas defined inCmn/Gen.php).
6. Test Data Setup
- Plugin Configuration: Ensure Seraphinite Accelerator is active.
- Generate Logs:
- Navigate through various site pages to trigger operational logging.
- If a "Debug Mode" exists in the plugin settings, enable it via WP-CLI:
wp option update seraph_accel_sett '{"cache":{"enable":true,"debug":true}}' --format=json(Structure inferred).
- Verify Log Existence:
- Check for log files in
wp-content/uploads/seraph_accel/orwp-content/seraph_accel/. - Check for log data in the database:
wp option get seraph_accel_log.
- Check for log files in
- Create Attacker User:
wp user create attacker attacker@example.com --role=subscriber --user_pass=password
7. Expected Results
- Response: The HTTP response should indicate success (HTTP 200 and potentially a JSON body indicating a success code
0). - Action: The log file on the filesystem should be empty or deleted, or the corresponding database option should be cleared.
8. Verification Steps
- Filesystem Check:
- Run
ls -l wp-content/uploads/seraph_accel/before and after the exploit to see if the log file size changes to 0 or is deleted.
- Run
- Database Check:
- Run
wp option get seraph_accel_log(or similar) to confirm the log data is gone.
- Run
- UI Verification:
- Login as Admin and visit the plugin's "Logs" or "Manage" page to see if the log viewer is empty.
9. Alternative Approaches
- Parameter Variation: If
_wpnonceis not the correct parameter name, trynonce. - Action Variation: If
seraph_accel_apidoes not work, checkmain.phpfor other registered AJAX actions that might handle sub-functions viafn. - GET vs POST: While AJAX is typically POST, some WordPress handlers incorrectly process GET requests. If POST fails, try the same parameters via GET.
Summary
The Seraphinite Accelerator plugin for WordPress (versions <= 2.28.14) fails to perform authorization checks on certain AJAX functions. This allows authenticated users with Subscriber-level access to clear the plugin's operational and debug logs by invoking the 'LogClear' function through the 'seraph_accel_api' AJAX action.
Vulnerable Code
// main.php line 2307 function OnAdminApi_GetData( $args ) { $siteId = !($args[ 'allSites' ]??null) ? GetSiteId() : null; $res = array(); // ... (truncated) --- // main.php line 2478 function OnAdminApi_LogClear( $args ) { Gen::LogClear( GetCacheDir() . LogGetRelativeFile(), true ); }
Security Fix
@@ -2307,10 +2307,12 @@ function OnAdminApi_GetData( $args ) { + $res = array(); - $siteId = !($args[ 'allSites' ]??null) ? GetSiteId() : null; + if( !current_user_can( 'manage_options' ) ) + return( $res ); - $res = array(); + $siteId = !($args[ 'allSites' ]??null) ? GetSiteId() : null; if( $siteId ) { @@ -2478,6 +2480,9 @@ function OnAdminApi_LogClear( $args ) { + if( !current_user_can( 'manage_options' ) ) + return; + Gen::LogClear( GetCacheDir() . LogGetRelativeFile(), true ); }
Exploit Outline
The exploit involves an authenticated attacker with Subscriber-level privileges obtaining a valid nonce and sending a forged AJAX request. 1. Log into the WordPress site as a Subscriber. 2. Access any admin dashboard page (e.g., /wp-admin/profile.php) where the plugin's admin scripts are localized. 3. Extract the AJAX nonce from the global JavaScript object (typically `seraph_accel_admin.nonce`). 4. Send a POST request to `/wp-admin/admin-ajax.php` with the following parameters: - `action`: `seraph_accel_api` - `fn`: `LogClear` - `_wpnonce`: [The extracted nonce] 5. Since the `OnAdminApi_LogClear` function lacks a `current_user_can()` check, the plugin will truncate the log files located in the cache directory.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.