CVE-2026-4303 Overview
CVE-2026-4303 is a Stored Cross-Site Scripting (XSS) vulnerability in the WP Visitor Statistics (Real Time Traffic) plugin for WordPress. The flaw exists in the plugin's wsm_showDayStatsGraph shortcode and affects all versions up to and including 8.4. The plugin fails to properly sanitize input or escape output on user-supplied shortcode attributes [CWE-79]. Authenticated attackers with contributor-level access or higher can inject arbitrary JavaScript into pages. The injected script executes in the browser of any user who views the affected page, including administrators.
Critical Impact
Authenticated contributors can plant persistent JavaScript payloads that execute against site visitors and administrators, enabling session theft, admin account compromise, and full site takeover when an administrator views the injected content.
Affected Products
- WP Visitor Statistics (Real Time Traffic) plugin for WordPress, all versions through 8.4
- WordPress sites permitting contributor-level (or higher) account creation
- Any site using the vulnerable wsm_showDayStatsGraph shortcode
Discovery Timeline
- 2026-04-08 - CVE-2026-4303 published to NVD
- 2026-04-24 - Last updated in NVD database
Technical Details for CVE-2026-4303
Vulnerability Analysis
The vulnerability is a Stored XSS issue rooted in unsafe shortcode attribute handling. The plugin registers the wsm_showDayStatsGraph shortcode in wsm_init.php and renders attribute values in wsm_statistics.php without applying WordPress escaping functions such as esc_attr() or esc_html(). Because shortcodes can be embedded inside posts and pages by users with contributor privileges, an attacker only needs the ability to author content. Once an editor or administrator publishes the post, or even previews it, the malicious script executes in their authenticated session context. The Scope:Changed nature of the issue means a contributor-level account can pivot to actions in a higher-privileged administrator context.
Root Cause
The root cause is insufficient input sanitization and output escaping on attributes passed to the wsm_showDayStatsGraph shortcode handler. Attribute values flow directly from shortcode_atts() into rendered HTML output without filtering through esc_attr(), wp_kses(), or comparable escaping APIs. This violates the WordPress secure coding requirement of escaping late and escaping all dynamic output.
Attack Vector
An authenticated attacker holding contributor permissions or higher inserts the wsm_showDayStatsGraph shortcode into a draft post or page, supplying malicious JavaScript inside one of the accepted attributes. When the post is previewed, reviewed, or published, the payload renders in the DOM and executes in the viewer's browser. Administrators reviewing contributor submissions are the highest-value targets because their cookies and nonces permit account creation, plugin installation, and arbitrary PHP execution through theme editing. Refer to the Wordfence Vulnerability Analysis and the vulnerable code in wsm_statistics.php line 2272 for technical specifics.
No verified exploit code is publicly available. The vulnerability manifests
when a contributor embeds the wsm_showDayStatsGraph shortcode with an
attribute value containing unescaped HTML or JavaScript. See the
Wordfence advisory and WordPress plugin trac references for details.
Detection Methods for CVE-2026-4303
Indicators of Compromise
- Posts, pages, or custom post type entries containing the wsm_showDayStatsGraph shortcode authored by contributor or author roles
- Shortcode attribute values containing <script>, onerror=, onload=, javascript:, or HTML entity-encoded payloads
- Unexpected outbound requests from administrator browsers to attacker-controlled domains shortly after reviewing contributor content
- New administrator accounts or modified user roles following content review activity
Detection Strategies
- Query the wp_posts table for post_content LIKE '%wsm_showDayStatsGraph%' and review attribute values for HTML or script syntax
- Monitor WordPress audit logs for contributor accounts publishing or editing content containing shortcodes
- Inspect web server access logs for unusual referers or outbound POSTs originating from /wp-admin/ sessions
- Use WordPress security scanners to flag the plugin while it remains at version 8.4 or earlier
Monitoring Recommendations
- Alert on creation of new contributor-level accounts followed by rapid content authoring activity
- Track administrator session anomalies such as unexpected users.php or plugin-install.php requests
- Log and review all shortcode usage in posts authored by non-administrator roles
- Continuously monitor the WordPress plugin changelog at the WordPress plugin trac for a patched release
How to Mitigate CVE-2026-4303
Immediate Actions Required
- Update the WP Visitor Statistics plugin to a version newer than 8.4 once the vendor publishes a fix
- Audit all existing posts and pages for the wsm_showDayStatsGraph shortcode and remove suspicious attribute content
- Restrict contributor and author role assignments to trusted users only
- Review administrator accounts and rotate credentials for any account that previewed contributor content during the exposure window
Patch Information
As of the last NVD modification date (2026-04-24), the plugin remains vulnerable through version 8.4. Monitor the WordPress Changeset Update page and the Wordfence Vulnerability Analysis for the official fixed version. Apply the update across all WordPress instances once released.
Workarounds
- Deactivate the WP Visitor Statistics plugin until a patched version is available
- Remove or demote contributor and author accounts that are not strictly required
- Deploy a Web Application Firewall (WAF) rule blocking wsm_showDayStatsGraph shortcode attributes containing <, >, or script tokens
- Disable shortcode rendering in post previews for non-administrator roles via custom capability filters
# Temporarily disable the vulnerable plugin via WP-CLI
wp plugin deactivate wp-stats-manager
# Audit posts for the vulnerable shortcode
wp db query "SELECT ID, post_title, post_author FROM wp_posts \
WHERE post_content LIKE '%wsm_showDayStatsGraph%';"
# Remove contributor capability to use unfiltered HTML
wp cap remove contributor unfiltered_html
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


