Atomic Edge analysis of CVE-2025-13048:
The Official StatCounter plugin for WordPress, versions up to and including 2.1.0, contains an authenticated stored cross-site scripting (XSS) vulnerability. The vulnerability exists in the plugin’s author tag output functionality. Attackers with Contributor-level access or higher can inject malicious scripts that execute in the context of any user viewing a post. The CVSS score of 6.4 reflects the authentication requirement and the potential for session hijacking or administrative actions.
Atomic Edge research identifies the root cause as insufficient output escaping in the `statcounter_add_author_tag()` function. This function retrieves the post author’s nickname via `get_the_author_meta(‘nickname’, $authorId)` and outputs it directly into a JavaScript context without proper escaping. The vulnerable code is located in the main plugin file `StatCounter-Wordpress-Plugin.php` at lines 301-310 in the patched version. The nickname value originates from the WordPress user profile, which Contributor-level users can modify.
Exploitation requires an authenticated attacker with at least Contributor privileges. The attacker modifies their own nickname field in their WordPress user profile to include a malicious JavaScript payload. When the attacker creates or edits a post, the plugin’s `statcounter_add_author_tag()` function executes on single post pages. This function outputs the unescaped nickname value into a JavaScript array assignment, allowing script execution. The payload delivers via the `wp-admin/profile.php` endpoint through the `nickname` parameter.
The patch in version 2.1.1 adds proper output escaping using `esc_js()` on the nickname value before output. The diff shows line 308 in the patched file now reads `echo esc_js($nickname);`. Previously, the nickname variable was output directly without escaping. The `esc_js()` function encodes text for safe use within JavaScript strings, preventing script injection. This change ensures that any HTML or JavaScript characters in the nickname are properly encoded as JavaScript string literals.
Successful exploitation allows attackers to inject arbitrary JavaScript that executes in the browser of any user viewing a post authored by the attacker. This can lead to session hijacking, administrative actions performed by logged-in users, content modification, or redirection to malicious sites. The stored nature means the payload persists and executes each time the post loads, creating a persistent threat.







