Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-97341 Overview
CVE-2026-97341 affects the Visitor Traffic Real Time Statistics plugin for WordPress in all versions up to and including 8.16. The plugin fails to sanitize the X-Real-IP HTTP header before storing it in the database, producing a stored DOM-based Cross-Site Scripting (XSS) condition [CWE-79]. Unauthenticated attackers can inject arbitrary JavaScript that executes when administrators or visitors load pages rendering the captured value. Exploitation requires no authentication, no nonce, and no capability check, because the wp_ajax_nopriv_ahcfree_track_visitor endpoint accepts forged headers from any HTTP client.
Critical Impact
Unauthenticated attackers can inject persistent JavaScript into WordPress analytics pages, enabling session theft, administrative action forgery, and malicious redirection against logged-in users.
Affected Products
- Visitor Traffic Real Time Statistics plugin for WordPress — all versions through 8.16
- WordPress sites running the visitors-traffic-real-time-statistics plugin
- Administrative dashboards that render stored visitor IP data via plugin JavaScript
Discovery Timeline
- 2026-10-03 - CVE-2026-97341 published to the National Vulnerability Database (NVD)
- 2026-10-06 - Last updated in NVD database
Technical Details for CVE-2026-97341
Vulnerability Analysis
The vulnerability lives in the plugin's visitor tracking pipeline. The AJAX action wp_ajax_nopriv_ahcfree_track_visitor is registered for unauthenticated users and reads the client IP address from HTTP request headers, including the attacker-controlled X-Real-IP header. The plugin applies entity encoding and inserts the value into the database, but downstream JavaScript code decodes and renders the value through DOM sinks on dashboard pages. The decoded string reaches an innerHTML-style sink, which parses and executes injected <script> or event-handler payloads.
Because the payload is persisted, every visit to the affected analytics view re-triggers the script in the context of the WordPress origin. Attackers can hijack administrator sessions, pivot to plugin or theme editing, and modify site content.
Root Cause
The root cause is insufficient input sanitization combined with unsafe client-side output handling. Server-side entity encoding is reversed by JavaScript that decodes the value before writing to the DOM. The relevant code paths are documented in the plugin source review for WPHitsCounter.php and js/ahcfree_js_scripts.js. See WordPress WPHitsCounter Code Review and WordPress JS Functions Code Review for the vulnerable sinks.
Attack Vector
An unauthenticated attacker sends a crafted HTTP POST to admin-ajax.php targeting the ahcfree_track_visitor action. The request includes a forged X-Real-IP header containing an XSS payload. The plugin stores the payload. When a WordPress administrator loads the plugin's statistics dashboard, the stored value is decoded client-side and injected into the DOM, executing attacker JavaScript with the administrator's session context.
// No verified public exploit code is available.
// Technical sinks are described in the Wordfence advisory and
// WordPress plugin trac references listed under External References.
Detection Methods for CVE-2026-97341
Indicators of Compromise
- POST requests to /wp-admin/admin-ajax.php with action=ahcfree_track_visitor originating from unauthenticated sources
- X-Real-IP header values containing non-IP characters such as <, >, script, onerror, or URL-encoded JavaScript
- Unexpected <script> tags or event handlers in the plugin's visitor_log database table
- Outbound requests from administrator browsers to unfamiliar domains immediately after loading plugin dashboards
Detection Strategies
- Inspect web server access logs for ahcfree_track_visitor requests paired with malformed X-Real-IP headers
- Query the plugin database tables for stored values that fail strict IPv4 or IPv6 regex validation
- Monitor WordPress admin sessions for anomalous XHR or fetch activity following dashboard access
- Alert on new administrator account creation or plugin installation events shortly after dashboard views
Monitoring Recommendations
- Forward WordPress and reverse-proxy logs to a central analytics platform for header-value inspection
- Enable Content Security Policy (CSP) reporting to capture inline script execution attempts
- Track plugin file integrity to identify unauthorized modifications to PHP or JavaScript resources
How to Mitigate CVE-2026-97341
Immediate Actions Required
- Update the Visitor Traffic Real Time Statistics plugin to the latest patched release above 8.16
- Deactivate and remove the plugin if a patched version cannot be deployed immediately
- Audit the plugin's visitor data tables for stored script payloads and purge malicious rows
- Rotate WordPress administrator credentials and invalidate active sessions after cleanup
Patch Information
The plugin maintainers published a fix in the WordPress plugin repository. Review the diff at WordPress Plugin Change Set Details and the full advisory at the Wordfence Vulnerability Report. Apply the update through the WordPress admin plugin screen or via WP-CLI.
Workarounds
- Block or sanitize the X-Real-IP header at the reverse proxy or Web Application Firewall (WAF) before it reaches WordPress
- Add a WAF rule denying requests to admin-ajax.php where action=ahcfree_track_visitor and headers contain HTML metacharacters
- Restrict access to the plugin's statistics dashboard pages using an IP allowlist until the patch is applied
# Example: strip or validate X-Real-IP at nginx before proxying to WordPress
map $http_x_real_ip $clean_real_ip {
"~^[0-9a-fA-F:.]+$" $http_x_real_ip;
default "";
}
server {
location / {
proxy_set_header X-Real-IP $clean_real_ip;
proxy_pass http://wordpress_backend;
}
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

