Security Alert Summary
The Elementor Website Builder plugin for WordPress has a stored cross-site scripting (XSS) vulnerability via the _elementor_data post meta when processing form-encoded REST API requests. Authenticated users with contributor-level access and above can cause unsanitized data to be saved and later output without escaping, allowing injected scripts to run when an affected page is viewed.
CVE Details
- CVE ID: CVE-2026-6127
- Affected component: Elementor Website Builder plugin for WordPress
- Affected versions: versions up to, and including, 4.0.4
- Published: May 1, 2026, 6:16:32 AM
- Last modified: May 1, 2026, 3:26:24 PM
- CVSS v3.1: Base Score 6.4 (MEDIUM) —
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N - Authentication / Privileges / User interaction: Requires authenticated user with low privileges (contributor-level access or above); no user interaction required.
- Primary impact: Confidentiality: Low; Integrity: Low; Availability: None
- Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation — Cross-site Scripting)
Technical Details
This vulnerability is a stored cross-site scripting (XSS) issue stemming from insufficient input sanitization when the plugin processes form-encoded REST API requests. The plugin registers the _elementor_data post meta with show_in_rest but does not provide a sanitize_callback. Instead, it relies on a rest_pre_insert_post filter (the sanitize_post_data function) that only sanitizes JSON-encoded request bodies.
When a contributor sends a form-encoded PATCH request to the WordPress REST API, a json_decode() call on the raw request body returns null, which causes the JSON-specific sanitization to be skipped. The unsanitized data is then stored using update_post_meta(). Later, the data may be output without escaping through multiple widget sinks, including the HTML widget’s print_unescaped_setting() function, enabling execution of injected scripts in pages that include the affected widget content.
The issue exists because form-encoded requests are not covered by the plugin’s sanitization path, allowing contributor-level authenticated users to persist HTML/JS payloads that are rendered unescaped.
How This Could Impact Your Website
In a realistic scenario, an internal contributor or an external contractor with contributor access could edit a page via the REST API using a form-encoded PATCH request and insert a malicious script into a widget setting. When that page is viewed by site staff, editors, or visitors, the script could execute in their browsers. Practical consequences include exposure of visible or accessible data on the page, an increased risk of targeted phishing or social engineering against staff who visit affected pages, and user session or cookie theft in cases where a victim’s browser permits it.
The CVSS impact ratings indicate confidentiality and integrity impacts are low, so this vulnerability should not be interpreted as an automatic full site compromise. If you’re unsure whether your site is affected or how to assess your current user roles and plugins, it may be worth having a professional review.
Recommended Actions
- Update the affected plugin as soon as a patched version is available.
- Review and reduce unnecessary user roles, especially contributor accounts that do not require content publishing privileges.
- Enforce strong passwords and enable two-factor authentication for editors and administrators.
- Remove unused or unmaintained plugins and themes to reduce attack surface.
- Monitor site activity and logs for unusual behavior, including unexpected REST API requests or changes to post meta fields.
If you’d like help reviewing your plugins, user roles, or overall WordPress security posture, our team at Freshy is happy to help.
References
- https://plugins.trac.wordpress.org/browser/elementor/tags/4.0.1/includes/base/widget-base.php#L794
- https://plugins.trac.wordpress.org/browser/elementor/tags/4.0.1/includes/plugin.php#L840
- https://plugins.trac.wordpress.org/browser/elementor/tags/4.0.1/modules/wp-rest/classes/elementor-post-meta.php#L68
- https://plugins.trac.wordpress.org/browser/elementor/trunk/includes/base/widget-base.php#L794
- https://plugins.trac.wordpress.org/browser/elementor/trunk/includes/plugin.php#L840
- https://plugins.trac.wordpress.org/browser/elementor/trunk/modules/wp-rest/classes/elementor-post-meta.php#L68
- https://plugins.trac.wordpress.org/changeset/3519457/
- https://www.wordfence.com/threat-intel/vulnerabilities/id/826a2003-c526-4760-8c21-10d5ae7bb384?source=cve