/

CVE-2026-15780

Severity:

HIGH RISK

(7.2)

Stored XSS (CWE-79) in WP Statistics WordPress Plugin

CVE-2026-15780

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Arbitrary Script Execution in a Victim's Browser

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

WP Statistics contains a stored cross-site scripting vulnerability in the utm_campaign parameter because input is not sufficiently sanitized and output is not safely escaped. An unauthenticated attacker may be able to store a script that executes when another user views an affected page, including users with elevated WordPress privileges.

Affected context

The vulnerability affects WordPress sites using the WP Statistics plugin where the public /wp-statistics/v2/hit REST endpoint accepts tracking data and stores campaign-related values. Risk increases when the endpoint's public signature and request handling allow attacker-controlled values to reach persistent storage without complete validation and when those values are later rendered without context-appropriate output encoding.

Exploit preconditions

  • Attack surface: Public WordPress REST endpoint used for statistics tracking
  • Required access: No authentication may be required when the endpoint and its public request signature are accessible
  • Trigger point: A stored tracking value is rendered in a page viewed by a user
  • Why exploitation is possible: Request processing permits attacker-controlled campaign data to bypass or evade sanitization, persist in the database, and later reach an HTML or script-capable output context without adequate escaping

Why this happens

The underlying bug is a failure to maintain a trustworthy input and output boundary for the utm_campaign value. Request data is insufficiently validated before storage, while later rendering does not consistently apply context-aware output encoding. This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly called cross-site scripting, because attacker-controlled content is treated as page markup or executable script rather than inert data.

Potential impact

  • An attacker could execute arbitrary script in a victim's browser context
  • The vulnerability may enable theft of accessible session data or non-HttpOnly tokens
  • An attacker could alter page content or perform actions on behalf of a victim
  • Administrative users could be targeted, potentially increasing the consequences for the WordPress site
  • The issue could undermine user trust and site integrity

General mitigation guidance

Mitigation generally focuses on treating all tracking parameters as untrusted data throughout their lifecycle.

Common defensive patterns include:

  • Applying allowlist-based validation appropriate to campaign identifiers before persistence
  • Using context-aware output escaping at every rendering location
  • Avoiding trust in encoded or alternate request representations when enforcing validation
  • Separating telemetry ingestion from page-generation logic where practical
  • Restricting endpoint capabilities, rate, and data retention to the minimum required
  • Applying least privilege to WordPress users, service accounts, and administrative sessions
  • Using a restrictive Content Security Policy as a defense-in-depth control

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying unsanitized request values written to storage or rendered into HTML
  • Code review checks covering REST parameter validation, decoding order, and output contexts
  • Tests that submit unexpected markup through every accepted representation of a parameter and verify safe rendering
  • Monitoring for unusual requests to public tracking endpoints and anomalous campaign values
  • Policy enforcement requiring centralized validation and context-specific escaping for WordPress output
  • Automated security review tools that flag source-to-sink paths involving request parameters

Sources

SourceLink
github.comgithub.com/wp-statistics/wp-statistics/commit/6ab74427778b89c9e88471e9dd7407d9055a9b34
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.7/assets/dev/javascript/helper.js#L267
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.7/includes/api/v2/class-wp-statistics-api-hit.php#L78
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.7/includes/class-wp-statistics-helper.php#L1462
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.7/includes/class-wp-statistics-hits.php#L102
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.7/views/components/tables/referred-visitors.php#L79
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.7/views/components/tables/visitors.php#L94
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.8/assets/dev/javascript/helper.js#L267
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.8/includes/api/v2/class-wp-statistics-api-hit.php#L78
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.8/includes/class-wp-statistics-helper.php#L1462
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.8/includes/class-wp-statistics-hits.php#L102
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.8/views/components/tables/referred-visitors.php#L79
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/wp-statistics/tags/14.16.8/views/components/tables/visitors.php#L94
wordfence.comwordfence.com/threat-intel/vulnerabilities/id/b5baecfe-ce0b-4cec-8462-bfd7eadd41e9?source=cve

Frequently asked

questions

Yes. The described attack surface is a public WordPress REST endpoint, so exploitation may not require network access beyond the affected site or prior authentication.

Not necessarily. The endpoint can accept requests without authentication when its public signature and request-processing conditions are available.

Treat campaign parameters as untrusted, validate them before storage, and apply context-aware output escaping wherever they are displayed.

Use centralized input validation, test encoded and alternate request representations, enforce output-escaping policies, and monitor public telemetry endpoints for abuse.

Find out what's already
exploitable in your codebase.