What the vulnerability does
01Description
The WP Random Button plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'cat', 'nocat', and 'text' shortcode attributes of the 'wp_random_button' shortcode in all versions up to, and including, 1.0. This is due to insufficient input sanitization and output escaping on user-supplied shortcode attributes. Specifically, the random_button_html() function directly concatenates the 'cat' and 'nocat' parameters into HTML data-attributes without esc_attr(), and the 'text' parameter into HTML content without esc_html(). 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.
Explanation of Vulnerability in Simple Terms
02Summary
WP Random Button versions 1.0 and earlier contain a cross-site scripting (XSS) vulnerability that allows authenticated users to inject malicious scripts affecting other site visitors. The vulnerability exists due to insufficient input sanitization in the plugin's output. An attacker with low-level site access can craft malicious content that executes in the browsers of other users, potentially compromising their sessions or stealing sensitive data.
What an attacker can do
03Attacker Capabilities
Inject malicious JavaScript that runs in other users' browsers and affects site functionality.
Potential impact on your site
04Site Impact
Authenticated attackers can inject scripts affecting all site visitors, risking session hijacking or data theft.
Conditions required to exploit
05Prerequisites
Attacker must have a low-privilege account on the site (e.g., subscriber or contributor role).
Key dates
06Disclosure timeline
March 21, 2026
CVE published
April 8, 2026
Record updated