Skip to main content

CVE-2025-2575: Wpzita Z Companion XSS Vulnerability

CVE-2025-2575 is a stored cross-site scripting vulnerability in Wpzita Z Companion plugin for WordPress that enables authenticated attackers to inject malicious scripts via SVG uploads. This article covers technical details, affected versions, security impact, and recommended mitigation strategies.

Published:

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-2025-2575 Overview

CVE-2025-2575 is a Stored Cross-Site Scripting (XSS) vulnerability in the Z Companion plugin for WordPress [CWE-79]. The flaw affects all versions up to and including 1.1.1 and stems from insufficient input sanitization and output escaping during Scalable Vector Graphics (SVG) file uploads. Authenticated attackers with Author-level access or higher can inject arbitrary JavaScript that executes whenever a user accesses the uploaded SVG file. Exploitation requires the Royal Shop theme to be installed alongside the vulnerable plugin.

Critical Impact

Authenticated users with Author privileges can upload malicious SVG files containing JavaScript that executes in the browser context of any site visitor who accesses the file, enabling session theft, defacement, and administrative action hijacking.

Affected Products

  • Wpzita Z Companion plugin for WordPress, versions ≤ 1.1.1
  • Deployments where the Royal Shop theme is installed
  • WordPress sites allowing Author-level account registration or with compromised Author accounts

Discovery Timeline

  • 2025-04-11 - CVE-2025-2575 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-2575

Vulnerability Analysis

The vulnerability resides in the import functionality shipped with the Z Companion plugin, specifically in the WordPress eXtended RSS (WXR) importer components at import/importer/wxr-importer.php and import/inc/importer.php. The plugin accepts SVG files during the import process without sanitizing embedded scripts or event handlers. SVG is an XML-based image format that natively supports <script> elements and inline event handlers such as onload and onclick.

When the plugin stores an attacker-supplied SVG without stripping executable content, any browser that renders the file directly will execute the embedded JavaScript. The script runs within the origin of the WordPress site, giving the attacker access to cookies, session tokens, and the Document Object Model (DOM) of authenticated users who view the file. This includes administrators who may be reviewing uploaded media.

Root Cause

The root cause is missing input sanitization and output escaping on SVG uploads processed by the plugin's importer. WordPress does not permit SVG uploads by default; however, the Z Companion importer bypasses standard media filtering while handling WXR import payloads. The plugin fails to parse the SVG XML tree and remove <script> tags, <foreignObject> elements, and on* event attributes before persisting the file to the uploads directory.

Attack Vector

An authenticated attacker with Author-level access or higher triggers the plugin's import workflow and supplies a crafted SVG file. The server stores the file in the WordPress uploads directory with its scripts intact. The payload executes when any user, including an administrator, navigates to the SVG's public URL. The scope-change characteristic allows the injected script to affect users beyond the attacker's own privilege context.

See the Wordfence Vulnerability Analysis and the vulnerable code paths in the WXR Importer source for technical details.

Detection Methods for CVE-2025-2575

Indicators of Compromise

  • SVG files in /wp-content/uploads/ containing <script> tags, <foreignObject> elements, or on* event handler attributes
  • Media library entries uploaded by Author-level accounts referencing .svg MIME types shortly after plugin import operations
  • Outbound requests from site visitors to attacker-controlled domains following access to SVG assets
  • Unexpected administrator session activity originating from referrers that include SVG file URLs

Detection Strategies

  • Scan the uploads directory recursively for SVG files and flag any containing <script, javascript:, onload=, onerror=, or onclick= substrings
  • Review WordPress audit logs for Author-role accounts invoking the Z Companion importer endpoints
  • Monitor web server access logs for direct .svg requests immediately followed by anomalous POST requests to /wp-admin/
  • Correlate browser Content Security Policy (CSP) violation reports with SVG asset URLs

Monitoring Recommendations

  • Enable WordPress file integrity monitoring for the wp-content/uploads/ and wp-content/plugins/z-companion/ directories
  • Alert on creation of new SVG files by non-administrator accounts
  • Log and review all plugin import operations, including source IP and user agent

How to Mitigate CVE-2025-2575

Immediate Actions Required

  • Update the Z Companion plugin to a version newer than 1.1.1 that incorporates the fix from WordPress Changeset #3270130
  • Audit all SVG files currently stored in the WordPress media library and remove any containing script content or event handlers
  • Review Author-level and higher accounts for signs of unauthorized access or privilege abuse
  • Rotate administrator session cookies and credentials if suspicious SVG files are found

Patch Information

The vendor addressed the vulnerability in WordPress Changeset #3270130. Site operators should update through the WordPress plugin management interface or by downloading the patched release from the plugin developer page.

Workarounds

  • Deactivate the Z Companion plugin until the patched version can be installed
  • Restrict import functionality to Administrator-level accounts via custom role management
  • Configure the web server to serve .svg files with Content-Disposition: attachment headers so browsers download rather than render them
  • Deploy a Content Security Policy that disallows inline script execution on uploaded media paths
bash
# Nginx configuration to force SVG downloads instead of inline rendering
location ~* \.svg$ {
    add_header Content-Disposition "attachment";
    add_header X-Content-Type-Options "nosniff";
}

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.