CVE-2026-135267 in Relevanssi Plugin
Summary
by MITRE • 11/26/2026
The Relevanssi – A Better Search plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'name (REST /wp/v2/tags) / tax_input[post_tag] (post save)' parameter in all versions up to, and including, 4.28.9 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. This is exploitable because WordPress's wp_filter_kses stores entity-encoded payloads (e.g., <img src=x onerror=...>) verbatim as literal text in the database, but Relevanssi's relevanssi_entity_decode() subsequently converts them into live HTML markup before the unescaped return branch of relevanssi_the_tags() splices them into the tag list consumed by the theme.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/26/2026
The vulnerability identified within the Relevanssi plugin for WordPress represents a significant security risk due to its potential for Stored Cross-Site Scripting, commonly referred to as XSS. This flaw exists in all versions of the plugin up through and including version 4.28.9. The core issue stems from insufficient input sanitization and output escaping mechanisms within the software architecture. Specifically, the vulnerability is triggered via two primary entry points: the name parameter associated with the REST API endpoint for tags located at /wp/v2/tags, and the tax_input[post_tag] parameter utilized during post save operations. These vectors allow an attacker to inject malicious scripts that are stored directly in the database rather than being executed immediately upon submission, which characterizes this as a persistent or stored attack vector rather than a reflected one.
The operational impact of this vulnerability is severe because it requires only contributor-level access or higher on the WordPress site for exploitation. This relatively low privilege requirement means that any user with basic content creation capabilities can compromise the integrity and security of the entire platform. When an authenticated attacker injects arbitrary web scripts through these parameters, the malicious code becomes embedded in the stored data. Consequently, whenever another user accesses a page containing this injected content, the browser executes the script within their session context. This can lead to unauthorized actions being performed on behalf of the victim, such as changing account settings, stealing sensitive cookies or session tokens, defacing the website, or redirecting users to malicious external sites designed for phishing or further malware distribution.
The technical mechanism behind this exploit involves a specific failure in how WordPress and the Relevanssi plugin handle HTML entities during data processing. When an attacker submits payload containing entity-encoded scripts, such as <img src=x onerror=alert(1)>, WordPress's wp_filter_kses function processes the input by storing these encoded strings verbatim in the database without decoding them into active markup at that stage. This behavior is generally intended to prevent immediate execution during storage. However, the Relevanssi plugin introduces a critical flaw through its relevanssi_entity_decode() function. When retrieving and displaying tag data, this function converts the stored entity-encoded payloads back into live HTML markup. Subsequently, the unescaped return branch of the relevanssi_the_tags() function splices these now-active scripts directly into the tag list that is rendered by the active theme. This sequence effectively bypasses WordPress's built-in protection mechanisms because the decoding happens after storage but before display, creating a window where stored malicious content becomes executable in the user's browser context.
From an industry standards perspective, this vulnerability aligns with CWE-79, which describes Improper Neutralization of Input During Web Page Generation, commonly known as Cross-site Scripting. The specific nature of storing the payload and executing it later places it firmly within the stored XSS category rather than reflected or DOM-based variants. In terms of attack tactics, this exploitation method corresponds to techniques found in the MITRE ATT&CK framework, particularly those related to Client-side Injection and potentially Account Manipulation if used for privilege escalation via session hijacking. The lack of proper output encoding when rendering dynamic content is a classic violation of secure coding principles that emphasize validating input at entry points and escaping data at every point of output.
To mitigate this vulnerability, immediate action must be taken by site administrators using affected versions of the Relevanssi plugin. The most effective remediation strategy is to upgrade the plugin to a version released after 4.28.9 where these sanitization and escaping issues have been addressed by the developers. Until an update can be applied, temporary mitigations may include restricting contributor-level access to trusted individuals only or implementing Web Application Firewall rules that detect and block attempts to inject script tags via REST API endpoints or post save parameters. Additionally, enabling Content Security Policy headers on the WordPress site can help mitigate the impact of any successful XSS attacks by restricting the sources from which scripts are allowed to execute, thereby reducing the effectiveness of injected payloads even if they bypass other defenses. Regular security audits and code reviews focusing on input validation and output encoding practices are essential for preventing similar vulnerabilities in custom plugins or themes that interact with WordPress core functions like wp_filter_kses.