CVE-2025-13141
Executive Summary
CVE-2025-13141 is a Stored Cross-Site Scripting (XSS) vulnerability in the HT Mega – Absolute Addons For Elementor WordPress plugin, affecting all versions up to and including 3.0.0. The flaw resides in the plugin’s Gutenberg blocks, where insufficient input validation on user-supplied HTML tag names allows authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. Despite the use of tag_escape() for sanitization, the lack of a tag name whitelist permits dangerous tags like script, iframe, and object. Additionally, while some blocks use esc_html() for content, this can be bypassed using JavaScript encoding techniques such as unquoted strings, backticks, and String.fromCharCode(). This results in persistent XSS that executes whenever a user accesses an injected page.
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. Users are advised to monitor the plugin’s update channel and apply any patches as soon as they become available. Since the patch status is currently unknown, manual mitigation is required.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level)
- User Interaction: Required (victim must visit the page)
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: Medium. While the CVSS score is moderate, the ease of exploitation and the potential for widespread impact on WordPress sites make this a significant concern.
Deep Dive & Mechanics
The vulnerability exists in the HT Mega plugin’s Gutenberg blocks, which allow users to insert custom HTML. The plugin uses tag_escape() to sanitize HTML tag names, but this function only escapes certain characters and does not enforce a whitelist of allowed tags. As a result, an attacker can inject tags like <script>, <iframe>, or <object>.
Furthermore, content sanitization using esc_html() can be bypassed. For example, an attacker can use JavaScript encoding techniques:
- Unquoted strings:
<script>alert(1)</script>(if quotes are stripped) - Backticks:
<script>alert1</script> - String.fromCharCode():
<script>eval(String.fromCharCode(97,108,101,114,116,40,49,41))</script>
This allows the attacker to execute arbitrary JavaScript in the context of the victim’s browser, leading to session hijacking, defacement, or malware distribution.
Vulnerable vs. Patched Code
Vulnerable Code (<= 3.0.0):
// Example of vulnerable tag handling
function render_block($attributes) {
$tag = tag_escape($attributes['tag']); // No whitelist
$content = $attributes['content'];
// Content is sometimes sanitized with esc_html(), but can be bypassed
return "<$tag>" . esc_html($content) . "</$tag>";
}
Patched Code (Hypothetical):
function render_block($attributes) {
$allowed_tags = ['div', 'span', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
$tag = in_array($attributes['tag'], $allowed_tags) ? $attributes['tag'] : 'div';
$content = wp_kses_post($attributes['content']); // Proper sanitization
return "<$tag>" . $content . "</$tag>";
}
The patched version would implement a whitelist of allowed tags and use wp_kses_post() for content sanitization.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress instance with HT Mega plugin <= 3.0.0
- Contributor-level account or higher
Exploit Steps:
- Log in as a contributor.
- Create a new post or page using the Gutenberg editor.
- Insert an HT Mega block that accepts custom HTML.
- In the tag name field, enter
script. - In the content field, enter:
alert(document.cookie) - Publish the post.
- When any user visits the post, the XSS payload executes.
Advanced Payload (Bypassing esc_html()):
<script>eval(String.fromCharCode(97,108,101,114,116,40,100,111,99,117,109,101,110,116,46,99,111,111,107,105,101,41))</script>
Blue Team (Detection & Defense)
Detection:
- Monitor for posts/pages containing suspicious HTML tags like
<script>,<iframe>, or<object>in Gutenberg blocks. - Look for encoded JavaScript patterns in post content.
Defense:
- Disable the HT Mega plugin until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads.
- Restrict contributor-level access to trusted users only.
Indicators of Compromise (IOCs)
File Indicators:
- Presence of
<script>tags in WordPress post/page content where HT Mega blocks are used. - Encoded JavaScript strings in post meta or content fields.
- Presence of
Network Indicators:
- Outbound connections to attacker-controlled domains from compromised pages.
- HTTP requests containing XSS payloads in POST data.
Log Indicators:
- WordPress audit logs showing creation of posts with unusual HTML tags by contributor-level users.
- Web server logs with requests containing
String.fromCharCodeor backtick patterns.
Detection Engineering
YARA Rule
rule CVE_2025_13141_HT_Mega_XSS {
meta:
description = "Detects stored XSS payloads targeting CVE-2025-13141 in HT Mega plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-13141"
strings:
$xss1 = /<script[^>]*>/ nocase
$xss2 = /<iframe[^>]*>/ nocase
$xss3 = /<object[^>]*>/ nocase
$encoded = /String\.fromCharCode\(/ nocase
$backtick = /`[^`]*`/ nocase
condition:
any of ($xss*) or $encoded or $backtick
}
Sigma Rule
title: CVE-2025-13141 HT Mega Stored XSS Detection
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects stored XSS attempts via HT Mega plugin Gutenberg blocks
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
http_method: 'POST'
http_path: '/wp-admin/post.php'
http_body|contains:
- '<script'
- '<iframe'
- '<object'
- 'String.fromCharCode'
- '`'
condition: selection
falsepositives:
- Legitimate use of JavaScript in posts by administrators
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-13141 HT Mega Stored XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the HT Mega plugin until a security patch is released.
- Review all posts and pages created by contributor-level users for malicious content.
- Implement a WAF rule to block XSS payloads targeting Gutenberg blocks.
Long-term Fix:
- The vendor must release a patched version that implements a tag name whitelist and uses
wp_kses_post()for content sanitization. - Users should update to the latest version once available.
Workarounds:
- Restrict contributor-level access to only trusted users.
- Use a security plugin like Wordfence to monitor for XSS attempts.
Report generated by Valters IT DevSecOps & CTI Division
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.