CVE-2026-6565

Style Kits – Advanced Theme Styles for Elementor <= 2.5.0 - Authenticated (Contributor+) Stored Cross-Site Scripting via Kit Title

mediumImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
6.4
CVSS Score
6.4
CVSS Score
medium
Severity
2.6.0
Patched in
1d
Time to patch

Description

The Style Kits – Advanced Theme Styles for Elementor, Elementor Kits & Elementor Patterns plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the '/wp-json/agwp/v1/tokens/save' endpoint kit title parameter in versions up to, and including, 2.5.0 due to insufficient input sanitization and output escaping in an admin attribute context. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

CVSS Vector Breakdown

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

Technical Details

Affected versions<=2.5.0
PublishedMay 26, 2026
Last updatedMay 27, 2026
Affected pluginanalogwp-templates

What Changed in the Fix

Changes introduced in v2.6.0

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

This research plan focuses on exploiting a Stored Cross-Site Scripting (XSS) vulnerability in the **Style Kits for Elementor** plugin (version <= 2.5.0). The vulnerability allows authenticated users with Contributor-level permissions to inject malicious scripts via a specific REST API endpoint used …

Show full research plan

This research plan focuses on exploiting a Stored Cross-Site Scripting (XSS) vulnerability in the Style Kits for Elementor plugin (version <= 2.5.0). The vulnerability allows authenticated users with Contributor-level permissions to inject malicious scripts via a specific REST API endpoint used for saving kit titles.


1. Vulnerability Summary

  • Vulnerability: Authenticated (Contributor+) Stored Cross-Site Scripting (XSS).
  • ID: CVE-2026-6565.
  • Location: REST API endpoint /wp-json/agwp/v1/tokens/save.
  • Sink: The kit title is rendered in an admin context (likely a kit list or the Elementor editor interface) without proper escaping, specifically within an "admin attribute context" (e.g., title="..." or value="...").
  • Cause: Insufficient sanitization of the title parameter during storage and missing escaping during output.

2. Attack Vector Analysis

  • Endpoint: POST /wp-json/agwp/v1/tokens/save
  • Authentication: Contributor or higher. Contributors can access the REST API and typically have the edit_posts capability, which often suffices for kit-related operations in this plugin.
  • Vulnerable Parameter: title (or a similar key representing the kit title in the JSON body).
  • Preconditions:
    1. Plugin active on a WordPress site with Elementor.
    2. An attacker session with at least Contributor privileges.
    3. A valid wp_rest nonce for authentication to the REST API.

3. Code Flow (Inferred)

  1. Entry: The plugin registers a REST route via register_rest_route('agwp/v1', '/tokens/save', ...) during rest_api_init.
  2. Permission Check: The permission_callback likely checks for current_user_can('edit_posts') rather than manage_options, allowing Contributors access.
  3. Processing: The callback function receives the WP_REST_Request. It extracts the title parameter from the request body.
  4. Storage: The title is saved to the database (likely in wp_options as part of a kit configuration or as a custom post type ang_tokens meta). No sanitize_text_field or similar filter is applied effectively to block HTML tags.
  5. Rendering: When an Administrator views the "Style Kits" dashboard or the Elementor editor, the plugin retrieves the stored title and echoes it inside an HTML attribute (e.g., <div title="[USER_INPUT]">) without using esc_attr().

4. Nonce Acquisition Strategy

The WordPress REST API requires a nonce for authenticated POST requests to prevent CSRF. The nonce must be for the action wp_rest.

  1. Identification: The wp_rest nonce is standard for the WordPress REST API. It is usually localized into the wpApiSettings JavaScript object on admin pages.
  2. Extraction Method:
    • Navigate to any admin page (e.g., /wp-admin/index.php) as the Contributor user.
    • Use the browser_eval tool to extract the nonce from the window object.
  3. Specific JS Variable: window.wpApiSettings.nonce.

5. Exploitation Strategy

Step 1: Authentication

Login as a Contributor user.

Step 2: Nonce Retrieval

Execute browser_navigate to /wp-admin/ and then browser_eval("window.wpApiSettings.nonce").

Step 3: Payload Injection

Send a POST request to the vulnerable endpoint using the http_request tool.

  • URL: https://[TARGET]/wp-json/agwp/v1/tokens/save
  • Method: POST
  • Headers:
    • X-WP-Nonce: [EXTRACTED_NONCE]
    • Content-Type: application/json
  • Body (Inferred JSON structure):
    {
      "title": "\"><script>alert('XSS_SUCCESS')</script>",
      "id": 0
    }
    
    Note: If id: 0 fails, a valid kit ID might be needed, but usually, saving a new token/kit uses 0 or omits the ID.

Step 4: Trigger XSS

Login as an Administrator and navigate to the Style Kits dashboard:
https://[TARGET]/wp-admin/admin.php?page=analogwp_templates (based on analogwp_templates slug in analogwp-templates.php).

6. Test Data Setup

  1. Plugin: Install and activate "Style Kits – Advanced Theme Styles for Elementor" version 2.5.0.
  2. Dependencies: Ensure Elementor is installed and activated (required by the plugin).
  3. User: Create a user with the Contributor role.
  4. Content: Create at least one "Style Kit" or "Token" if the endpoint requires an existing ID.

7. Expected Results

  • Injection: The REST API returns a 200 OK or 201 Created response.
  • Execution: When the Admin views the kit list, the payload "><script>alert('XSS_SUCCESS')</script> breaks out of the attribute and executes the JavaScript.
  • Response Analysis: Check if the script appears unescaped in the page source of the admin dashboard.

8. Verification Steps

  1. Check Database: Use WP-CLI to verify the stored value.
    • wp option get analog_tokens (or similar depending on storage choice).
    • Search for the payload: wp db query "SELECT * FROM wp_options WHERE option_value LIKE '%XSS_SUCCESS%'".
  2. DOM Verification: After navigating to the settings page as Admin, use browser_eval to check if the alert was triggered or if the element exists:
    • browser_eval("document.body.innerHTML.includes('XSS_SUCCESS')").

9. Alternative Approaches

  • Payload Contexts: If the "attribute context" is a value attribute inside an input, use:
    " onfocus="alert(1)" autofocus="
  • REST Parameters: If the JSON body is not accepted, try standard POST data:
    action=save_token&title=<script>alert(1)</script> (Check if the endpoint falls back to $_REQUEST).
  • Endpoint Variation: If /agwp/v1/tokens/save requires a specific ID, use GET /wp-json/agwp/v1/tokens first to list available IDs to overwrite.
Research Findings
Static analysis — not yet PoC-verified

Summary

The Style Kits for Elementor plugin is vulnerable to Stored Cross-Site Scripting via the kit title parameter of the '/wp-json/agwp/v1/tokens/save' REST API endpoint in versions up to 2.5.0. Authenticated attackers with Contributor-level access can inject malicious scripts that are stored on the server and executed in the browser of any administrator who subsequently views the plugin's dashboard.

Security Fix

--- /home/deploy/wp-safety.org/data/plugin-versions/analogwp-templates/2.5.0/analogwp-templates.php	2026-03-27 10:46:00.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/analogwp-templates/2.6.0/analogwp-templates.php	2026-05-12 16:43:12.000000000 +0000
@@ -10,17 +10,17 @@
  * Plugin Name: Style Kits for Elementor
  * Plugin URI:  https://analogwp.com/
  * Description: Style Kits extends the Elementor theme styles editor with more global styling options. Boost your design workflow in Elementor with intuitive global controls and theme style presets.
- * Version:     2.5.0
+ * Version:     2.6.0
  * Author:      AnalogWP
  * Author URI:  https://analogwp.com/
  * License:     GPL2
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
- * Text Domain: ang
+ * Text Domain: analogwp-templates
  * Requires at least: 6.0
  * Requires PHP: 7.4
  *
- * Elementor tested up to: 3.35.9
- * Elementor Pro tested up to: 3.35.1
+ * Elementor tested up to: 4.0.8
+ * Elementor Pro tested up to: 4.0.4
  */
 
 defined( 'ABSPATH' ) || exit;
@@ -28,7 +28,9 @@
 define( 'ANG_ELEMENTOR_MINIMUM', '3.32.0' );
 define( 'ANG_PHP_MINIMUM', '7.4' );
 define( 'ANG_WP_MINIMUM', '6.0' );
-define( 'ANG_VERSION', '2.5.0' );
+define( 'ANG_VERSION', '2.6.0' );
+define( 'ANG_TEXT_DOMAIN', 'analogwp-templates' );
+define( 'ANG_LEGACY_TEXT_DOMAIN', 'ang' );
 define( 'ANG_PLUGIN_FILE', __FILE__ );
 define( 'ANG_PLUGIN_URL', plugin_dir_url( ANG_PLUGIN_FILE ) );
 define( 'ANG_PLUGIN_DIR', plugin_dir_path( ANG_PLUGIN_FILE ) );

Exploit Outline

An authenticated attacker with Contributor-level permissions or higher can exploit this by first obtaining a REST API nonce from any admin page (usually found in the 'wpApiSettings.nonce' JavaScript variable). The attacker then sends a POST request to the '/wp-json/agwp/v1/tokens/save' endpoint with a JSON body including a 'title' parameter containing a malicious script, such as '"><script>alert(document.cookie)</script>'. The payload is stored in the database and executes whenever an administrator views the Style Kits dashboard (wp-admin/admin.php?page=analogwp_templates), as the plugin fails to escape the stored title when rendering it within an HTML attribute.

Check if your site is affected.

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