CVE-2024-4702
📋 TL;DR
The Mega Elements plugin for WordPress has a stored cross-site scripting (XSS) vulnerability in its Button widget. Authenticated attackers with contributor-level access or higher can inject malicious scripts that execute when users view compromised pages. This affects all versions up to and including 1.2.1.
💻 Affected Systems
- Mega Elements Addons for Elementor
📦 What is this software?
Mega Elements by Kraftplugins
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal session cookies, redirect users to malicious sites, deface websites, or perform actions on behalf of authenticated users.
Likely Case
Attackers with contributor access inject malicious scripts to steal admin credentials or perform limited site defacement.
If Mitigated
With proper input validation and output escaping, no script execution occurs, though malicious code may still be stored in the database.
🎯 Exploit Status
Exploitation requires contributor-level WordPress access. The vulnerability is in a popular plugin, making it an attractive target.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.2.2
Vendor Advisory: https://plugins.trac.wordpress.org/changeset/3085457/mega-elements-addons-for-elementor
Restart Required: No
Instructions:
1. Log into WordPress admin panel. 2. Navigate to Plugins > Installed Plugins. 3. Find 'Mega Elements Addons for Elementor'. 4. Click 'Update Now' if available, or manually update to version 1.2.2+. 5. Verify the update completed successfully.
🔧 Temporary Workarounds
Remove Contributor Access
allTemporarily restrict contributor-level user creation or limit existing contributor permissions.
Disable Button Widget
allDeactivate or remove the vulnerable Button widget from the plugin if possible.
🧯 If You Can't Patch
- Implement web application firewall (WAF) rules to block XSS payloads in POST requests.
- Regularly audit user accounts and remove unnecessary contributor-level access.
🔍 How to Verify
Check if Vulnerable:
Check WordPress admin panel > Plugins > Installed Plugins for Mega Elements Addons for Elementor version 1.2.1 or lower.
Check Version:
wp plugin list --name='mega-elements-addons-for-elementor' --field=version
Verify Fix Applied:
Confirm plugin version is 1.2.2 or higher in WordPress admin panel.
📡 Detection & Monitoring
Log Indicators:
- Unusual POST requests to WordPress admin-ajax.php with script tags in parameters
- Multiple failed login attempts followed by successful contributor login
Network Indicators:
- HTTP requests containing <script> tags in button widget parameters
- Unexpected outbound connections from WordPress site after page views
SIEM Query:
source="wordpress.log" AND ("mega-elements" OR "button-widget") AND ("<script>" OR "javascript:")
🔗 References
- https://plugins.trac.wordpress.org/changeset/3085457/mega-elements-addons-for-elementor
- https://www.wordfence.com/threat-intel/vulnerabilities/id/3808ca2a-e78e-4118-890b-c22a71f8e855?source=cve
- https://plugins.trac.wordpress.org/changeset/3085457/mega-elements-addons-for-elementor
- https://www.wordfence.com/threat-intel/vulnerabilities/id/3808ca2a-e78e-4118-890b-c22a71f8e855?source=cve