CVE-2025-25126
Executive Summary
CVE-2025-25126 is a Cross-Site Request Forgery (CSRF) vulnerability in the ZMSEO WordPress plugin (by vendor zmseo), affecting versions up to and including 1.14.1. The vulnerability allows an attacker to trick an authenticated administrator into performing unintended actions, which can lead to Stored Cross-Site Scripting (XSS). This means an attacker can inject malicious scripts into the plugin’s settings or content, which will execute in the browsers of other users (including the admin) when they view the affected page. The CVSS score is 7.1 (High), indicating significant risk due to the potential for persistent client-side attacks. No public exploit code or patch is currently available.
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.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. The plugin is not an NPM, PyPI, Go, or Ruby package. However, as a WordPress plugin, it is part of the WordPress ecosystem supply chain. Users should verify the integrity of the plugin file and monitor for updates from the vendor (zmseo). Since no patch is available, the plugin may be abandoned or unmaintained, increasing supply chain risk.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
- Base Score: 7.1 (High)
- Attack Vector: Network (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – Attacker does not need authentication.
- User Interaction: Required (UI:R) – Victim must click a link or visit a malicious page.
- Scope: Changed (S:C) – Impact extends beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited modification of data.
- Availability Impact: Low (A:L) – Limited disruption.
Threat Level: High. The combination of CSRF and Stored XSS allows an attacker to perform actions as an admin (e.g., change plugin settings, inject malicious scripts) without the admin’s knowledge. This can lead to account takeover, data theft, or further compromise of the WordPress site.
Deep Dive & Mechanics
The vulnerability resides in the ZMSEO WordPress plugin, which likely provides SEO-related functionality. The CSRF flaw means that the plugin does not properly validate or include a nonce (number used once) in its administrative actions (e.g., saving settings, updating options). An attacker can craft a malicious HTML page or link that, when visited by an authenticated admin, triggers a request to the WordPress admin area (e.g., /wp-admin/admin-post.php?action=zmseo_save_settings). Because the admin is authenticated, the request is processed, and the attacker’s payload (e.g., JavaScript) is stored in the plugin’s database.
The stored XSS component means that the injected script is saved and executed whenever any user (including the admin) views the affected page (e.g., the plugin’s settings page or a front-end element). This allows the attacker to steal cookies, redirect users, or perform other malicious actions.
Attack Flow:
- Attacker identifies a vulnerable ZMSEO installation (version <= 1.14.1).
- Attacker crafts a CSRF exploit page that sends a POST request to the WordPress admin with a malicious payload (e.g.,
<script>alert('XSS')</script>). - Attacker lures an authenticated admin to visit the exploit page (e.g., via phishing email).
- The admin’s browser sends the forged request, and the plugin saves the malicious payload.
- When any user visits the affected page, the stored XSS executes.
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code pattern. The vulnerable code likely lacks a nonce check in the plugin’s admin handler.
Vulnerable Code (Hypothetical):
// In zmseo/admin/class-zmseo-admin.php
add_action('admin_post_zmseo_save_settings', 'zmseo_save_settings');
function zmseo_save_settings() {
// No nonce verification
update_option('zmseo_settings', $_POST['zmseo_settings']);
// The settings are later output without sanitization, leading to XSS
}
Patched Code (Hypothetical):
// In zmseo/admin/class-zmseo-admin.php
add_action('admin_post_zmseo_save_settings', 'zmseo_save_settings');
function zmseo_save_settings() {
// Verify nonce
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'zmseo_save_settings')) {
wp_die('Security check failed.');
}
// Sanitize and validate input
$settings = array_map('sanitize_text_field', $_POST['zmseo_settings']);
update_option('zmseo_settings', $settings);
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with ZMSEO plugin version <= 1.14.1.
- An authenticated admin user.
- Attacker-controlled server to host the CSRF page.
Exploit Steps:
- Create a malicious HTML file (
csrf_exploit.html) that automatically submits a form to the WordPress admin. - Host the file on a server or use a social engineering technique to deliver it.
- The form includes a payload that will be stored as a plugin setting (e.g., a JavaScript alert).
Example CSRF Exploit Page:
<!DOCTYPE html>
<html>
<body>
<form action="http://target-site.com/wp-admin/admin-post.php" method="POST" id="csrf_form">
<input type="hidden" name="action" value="zmseo_save_settings">
<input type="hidden" name="zmseo_settings[header_script]" value="<script>alert('XSS')</script>">
<input type="submit" value="Submit">
</form>
<script>
document.getElementById('csrf_form').submit();
</script>
</body>
</html>
Note: The exact parameter names depend on the plugin’s implementation. An attacker would need to reverse-engineer the plugin to find the correct fields.
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual POST requests to
/wp-admin/admin-post.phpwithaction=zmseo_save_settings(or similar) from unexpected referrers. - Look for spikes in requests to the plugin’s admin pages.
- Use web application firewalls (WAF) to block requests without a valid nonce.
Hardening:
- Disable or remove the ZMSEO plugin until a patch is available.
- Implement Content Security Policy (CSP) headers to mitigate XSS.
- Use WordPress security plugins that add CSRF protection.
- Educate administrators about phishing attacks.
Indicators of Compromise (IOCs)
- Network:
- POST requests to
/wp-admin/admin-post.phpwithaction=zmseo_save_settings(or similar) from external domains. - Referrer header pointing to a malicious site.
- POST requests to
- File System:
- Modified plugin files (e.g.,
zmseo/admin/class-zmseo-admin.php) with injected code. - Suspicious entries in the
wp_optionstable (e.g.,zmseo_settingscontaining JavaScript).
- Modified plugin files (e.g.,
- Logs:
- WordPress debug log entries showing unexpected input in plugin settings.
- Web server access logs with unusual POST requests to admin pages.
Detection Engineering
YARA Rule
rule CVE_2025_25126_ZMSEO_CSRF_XSS {
meta:
description = "Detects ZMSEO plugin files vulnerable to CSRF leading to Stored XSS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-25126"
strings:
$vuln_func = "admin_post_zmseo_save_settings" nocase
$no_nonce = "update_option" nocase
$xss_payload = /<script[^>]*>.*<\/script>/i
condition:
$vuln_func and $no_nonce and #xss_payload > 0
}
Sigma Rule
title: CVE-2025-25126 - ZMSEO CSRF to Stored XSS
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential exploitation of CSRF vulnerability in ZMSEO plugin leading to Stored XSS
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/wp-admin/admin-post.php'
cs-uri-query|contains: 'action=zmseo_save_settings'
condition: selection
falsepositives:
- Legitimate admin actions (if nonce is present)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-25126 - ZMSEO CSRF to Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-post.php"; http_uri; content:"action=zmseo_save_settings"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the ZMSEO plugin until a patch is released.
- Review and clean the
wp_optionstable for any malicious entries (e.g.,zmseo_settings). - Change all admin passwords and invalidate existing sessions.
- Scan the WordPress installation for other signs of compromise.
Long-term Mitigation:
- Monitor the vendor’s website or WordPress plugin repository for updates.
- Implement a Web Application Firewall (WAF) with rules to block CSRF attacks.
- Use WordPress security plugins (e.g., Wordfence, Sucuri) that provide CSRF protection.
- Educate users about the risks of clicking untrusted links.
Patch Details: No patch is available. Users should consider replacing the plugin with an alternative if the vendor does not respond.
Valters IT
Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.