CVE-2026-13771

Customer Reviews for WooCommerce <= 5.113.0 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'color' Shortcode Attribute

mediumImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
6.4
CVSS Score
6.4
CVSS Score
medium
Severity
5.114.0
Patched in
1d
Time to patch

Description

The Customer Reviews for WooCommerce plugin for WordPress is vulnerable to Stored Cross-Site Scripting via 'color' Shortcode Attribute in all versions up to, and including, 5.113.0 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

CVSS Vector Breakdown

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Low
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=5.113.0
PublishedJuly 8, 2026
Last updatedJuly 9, 2026

What Changed in the Fix

Changes introduced in v5.114.0

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

I cannot fulfill your request to produce a detailed exploitation research plan or actionable payloads for this vulnerability. My safety guidelines prohibit the generation of instructions, specific HTTP requests, or functional payloads that facilitate the exploitation of security flaws. Instead, I c…

Show full research plan

I cannot fulfill your request to produce a detailed exploitation research plan or actionable payloads for this vulnerability. My safety guidelines prohibit the generation of instructions, specific HTTP requests, or functional payloads that facilitate the exploitation of security flaws.

Instead, I can discuss the underlying security principles and theoretical mechanics involved in this type of vulnerability and how to defend against them in WordPress development.

Technical Analysis: Insufficient Input Validation and Output Escaping

The vulnerability described (Stored XSS via a shortcode attribute) typically stems from two primary failures in the security lifecycle:

  1. Weak Input Validation (Sanitization): When processing shortcode attributes, it is crucial to ensure that the input strictly conforms to the expected format. If a regular expression is used for validation, it must be anchored to both the start (^) and end ($) of the string. Without these anchors, a pattern-matching function (like preg_match) may return true if a valid pattern exists anywhere in the string, even if the rest of the string contains malicious content (e.g., #ffffff";onload="alert(1)").
  2. Missing Output Escaping: Regardless of the sanitization applied at the input stage, data must always be escaped at the point of output (the "sink"). In WordPress, this means using context-specific functions such as esc_attr() when placing data into HTML attributes or esc_html() when placing data into the HTML body. If a variable is concatenated directly into a string that forms an HTML tag or attribute, an attacker can use special characters like quotes and brackets to "break out" of the intended context and execute arbitrary JavaScript.

General Defensive Best Practices

To secure WordPress plugins against such vulnerabilities, researchers and developers should focus on the following:

  • Validate on Input: Use strict validation for all user-controllable input, including shortcode attributes. For colors, ensure the value is a valid hex code or a predefined safe string.
  • Escape on Output: Always use the appropriate WordPress escaping function at the final moment of output. For data reflected in a style attribute, additional care must be taken to ensure the CSS property values are also safe.
  • Principle of Least Privilege: Ensure that sensitive functionality is restricted to the appropriate user roles and protected by capability checks (current_user_can()) and nonces (check_admin_referer() or check_ajax_referer()).

For further information on securing WordPress code, you may search for the "WordPress Plugin Handbook: Security" and the "OWASP Guide to Cross-Site Scripting (XSS)" online.

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.