Severity:

HIGH RISK

(7.2)

Stored XSS in SlimStat Analytics WordPress Plugin via

CVE-2026-7634

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Client-Side Code Execution / Session and Account Compromise

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A stored cross-site scripting (XSS) vulnerability in the SlimStat Analytics plugin for WordPress allows arbitrary JavaScript to be injected via the HTTP User-Agent header when input is not sanitized and output is not escaped.

When an administrator has explicitly enabled the show_complete_user_agent_tooltip setting, an unauthenticated attacker can store malicious scripts that execute in the browser of any user viewing the affected analytics pages.

Affected context

The issue occurs in WordPress sites using the SlimStat Analytics plugin where user-agent strings from HTTP requests are logged and later rendered in analytics views.

The vulnerability only becomes active when the show_complete_user_agent_tooltip option is turned on by an administrator, causing the full User-Agent value to be displayed in the browser.

In this context, the plugin fails to sanitize the stored User-Agent string and does not apply proper output escaping when embedding it into HTML, allowing active script content to be delivered to users viewing those pages.

Exploit preconditions

  • Attack surface: Public-facing WordPress site using the SlimStat Analytics plugin.
  • Required access: None; attackers can be completely unauthenticated and only need the ability to send HTTP requests to the site.
  • Trigger point: Viewing of SlimStat Analytics pages or tooltips that display the full User-Agent value, once show_complete_user_agent_tooltip is enabled.
  • Configuration requirement: The show_complete_user_agent_tooltip plugin setting must be explicitly enabled by an administrator (it is disabled by default).
  • Why exploitation is possible: Incoming User-Agent header values are stored without sufficient sanitization, and later rendered in an HTML context without appropriate escaping, allowing browser script execution.

Why this happens

This vulnerability is an instance of CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The plugin treats the HTTP User-Agent header as displayable text but does not neutralize script-capable characters (such as <, >, ", ') before storing and rendering them.

On output, the stored User-Agent value is embedded directly into the page or tooltip without context-appropriate escaping (e.g., HTML or attribute escaping).

This combination of unsanitized storage and unescaped output turns a passive logging feature into an active script injection channel whenever analytics views render the malicious value in a user's browser.

Potential impact

  • Attackers may execute arbitrary JavaScript in the context of the affected WordPress site's origin.
  • Malicious scripts could steal administrator or user cookies and nonces, enabling session hijacking or account takeover.
  • Attackers can modify the appearance or behavior of analytics pages, potentially misleading administrators or hiding other malicious activity.
  • Scripts may perform actions on behalf of authenticated users, such as changing settings, installing plugins, or altering content, depending on the victim's privileges.
  • The site may be used as a vehicle to deliver phishing content or browser-based malware to visitors who access affected analytics pages.

General mitigation guidance

Mitigation should focus on treating all request-derived data, including headers, as untrusted and enforcing strict output encoding.

Typical defensive patterns include:

  • Applying context-appropriate escaping (e.g., esc_html(), esc_attr() in WordPress) whenever rendering User-Agent or similar data into HTML or attributes.
  • Normalizing and sanitizing incoming analytics fields, including User-Agent strings, to remove or encode characters that can break out of the intended output context.
  • Using well-established output encoding utilities that align with the templating or framework conventions instead of manually concatenating user-provided values into HTML.
  • Restricting or simplifying analytics displays so that raw user-controlled headers are not rendered directly; favor summarized or sanitized representations instead.
  • Applying least-privilege principles to admin views and limiting exposure of detailed analytics data to only those roles that require it.

How teams detect issues like this

Detection can be approached at both code and runtime levels:

  • Static analysis: Configure rules that flag direct output of request-derived values (headers, query parameters, POST data) to HTML without passing through approved escaping functions.
  • Code review: Look for analytics or logging features that display raw HTTP metadata; verify that any such output uses the CMS's built-in escaping helpers and that sanitizer functions are consistently applied.
  • Policy enforcement: Introduce secure coding guidelines that mandate context-specific escaping for all user-controlled data and require security reviews for analytics and logging views.
  • Dynamic testing: Use automated scanners or manual tests to inject XSS payload markers into User-Agent headers and observe whether they are reflected or stored and later executed in admin or analytics pages.

Sources

SourceLink
github.comgithub.com/wp-slimstat/wp-slimstat/pull/297
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.11/admin/view/wp-slimstat-reports.php#L2099
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.11/src/Services/Browscap.php#L270
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.11/src/Tracker/Processor.php#L776
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.11/src/Tracker/Storage.php#L25
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.4/admin/view/wp-slimstat-reports.php#L2099
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.4/src/Services/Browscap.php#L270
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.4/src/Tracker/Processor.php#L776
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/tags/5.4.4/src/Tracker/Storage.php#L25
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/trunk/admin/view/wp-slimstat-reports.php#L2099
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/trunk/src/Services/Browscap.php#L270
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/trunk/src/Tracker/Processor.php#L776
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-slimstat/trunk/src/Tracker/Storage.php#L25
wordfence.comwordfence.com/threat-intel/vulnerabilities/id/0a309bf8-7fe3-4033-993c-3c8dba0f216d?source=cve

Frequently asked

questions

Yes. An attacker can exploit this remotely by sending crafted HTTP requests with a malicious User-Agent header; no authentication is required. The payload is stored and later executed in a victim's browser when the relevant analytics views are loaded and the vulnerable setting is enabled.

The attacker does not need administrative access to inject the payload, but the show_complete_user_agent_tooltip option must be enabled by an administrator for payload execution to occur. Victims typically include administrators or other privileged users who access the SlimStat analytics interface.

The safest pattern is to ensure robust output escaping for all user-controlled data at the point of rendering, combined with conservative input handling. In WordPress, this typically means always passing dynamic values through the appropriate esc_* functions and avoiding direct echoing of raw request data into HTML, attributes, or JavaScript contexts.

Adopting a secure-by-default view layer, enforcing a coding standard that requires context-aware escaping for all outputs, and subjecting analytics/logging features to security review help prevent similar issues. Integrating static analysis, security linters, and automated tests into the development pipeline can catch unsafe patterns involving user-controlled headers and other request data before release.

Find out what's already
exploitable in your codebase.