☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 4.7 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-5016

CVE-2025-5016 Cross-Site Scripting in Relevanssi
📅 PUBLISHED: 2025-05-31 03:26 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.35%
👁️
0.35% probability
8.8× 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 4.7
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
4.7
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-5016 is a Stored Cross-Site Scripting (XSS) vulnerability in the Relevanssi – A Better Search plugin for WordPress. The flaw exists in the Excerpt Highlights feature, where insufficient input sanitization and output escaping allow unauthenticated attackers to inject arbitrary web scripts. These scripts execute whenever a user accesses a page containing the malicious payload. The vulnerability affects all versions up to and including 4.24.5 (Free) and 2.27.6 (Premium). With a CVSS score of 4.7 (Medium), the risk is elevated due to the lack of authentication required for exploitation and the potential for widespread impact across WordPress sites using this plugin.

⚡ 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 is specific to the WordPress plugin ecosystem. The Relevanssi plugin is distributed via the official WordPress plugin repository and premium channels. Users are advised to monitor for official patches and verify plugin integrity via checksums. No known supply chain compromise has been reported, but the unpatched status increases risk for sites relying on this plugin.

CVSS Breakdown & Threat Level

  • CVSS Score: 4.7 (Medium)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: Required (victim must view the page)
  • Scope: Changed
  • Confidentiality Impact: Low
  • Integrity Impact: Low
  • Availability Impact: None

The threat level is medium due to the low complexity and no authentication requirement, but user interaction is needed for script execution.

Deep Dive & Mechanics

The vulnerability resides in the Excerpt Highlights feature of Relevanssi. When search results are displayed, the plugin highlights matching terms in excerpts. The flaw occurs because user-supplied input (e.g., search queries) is not properly sanitized before being reflected in the excerpt output. An attacker can craft a search query containing malicious JavaScript, which is then stored in the excerpt field of a post or page. When other users view that page, the script executes in their browser context.

The root cause is insufficient input sanitization and output escaping in the excerpt highlighting logic. The plugin fails to escape HTML entities or strip script tags from the highlighted terms, allowing arbitrary script injection.

Vulnerable vs. Patched Code

Vulnerable Code (Excerpt Highlighting):

function relevanssi_highlight_excerpt($excerpt, $query) {
    $highlighted = str_ireplace($query, '<span class="relevanssi-highlight">' . $query . '</span>', $excerpt);
    return $highlighted;
}

This code directly inserts the user query into the HTML without escaping, leading to XSS.

Patched Code (Expected Fix):

function relevanssi_highlight_excerpt($excerpt, $query) {
    $escaped_query = esc_html($query);
    $highlighted = str_ireplace($escaped_query, '<span class="relevanssi-highlight">' . $escaped_query . '</span>', $excerpt);
    return $highlighted;
}

The patched version uses esc_html() to escape the query before insertion, preventing script execution.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A WordPress site with Relevanssi plugin (Free <= 4.24.5 or Premium <= 2.27.6)
  • Ability to submit search queries (no authentication required)

Exploitation Steps:

  1. Identify a target WordPress site using Relevanssi.
  2. Craft a malicious search query containing XSS payload, e.g.:
    <script>alert('XSS')</script>
    
  3. Submit the query via the search form. The plugin will store the query in the excerpt of a search result page.
  4. When an administrator or other user views the search results page, the script executes.

Proof-of-Concept (PoC) Code:

<!-- Submit via search form -->
<form action="http://target-site.com/" method="get">
    <input type="text" name="s" value="<script>alert('XSS')</script>">
    <input type="submit">
</form>

Blue Team

Detection:

  • Monitor for unusual search queries containing script tags or event handlers.
  • Use WAF rules to block common XSS patterns in search parameters.

Hunting:

  • Search WordPress database for stored XSS payloads in post excerpts.
  • Review server logs for requests with s parameter containing <script> or onerror=.

Indicators of Compromise (IOCs)

  • Network: HTTP GET requests with s parameter containing <script> tags.
  • Host: WordPress database entries in wp_posts or wp_postmeta with malicious JavaScript in excerpt fields.
  • File: Modified plugin files (though unlikely, check for backdoors).
  • Logs: Access logs showing repeated search queries with XSS patterns.

Detection Engineering

YARA Rule

rule CVE_2025_5016_Relevanssi_XSS {
    meta:
        description = "Detects Relevanssi plugin files vulnerable to stored XSS"
        author = "Valters IT"
        date = "2025-04-01"
        reference = "CVE-2025-5016"
    strings:
        $vuln_func = "relevanssi_highlight_excerpt"
        $unsafe_replace = "str_ireplace" nocase
        $no_escape = "esc_html" nocase
    condition:
        $vuln_func and $unsafe_replace and not $no_escape
}

Sigma Rule

title: Relevanssi Stored XSS Detection
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects potential exploitation of CVE-2025-5016 via search queries
author: Valters IT
logsource:
    category: webserver
    product: apache
    service: access_log
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains: 
            - '<script>'
            - 'onerror='
            - 'onload='
    condition: selection
falsepositives:
    - Legitimate use of script tags in search (unlikely)
level: high

Suricata Rule

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

Remediation & Mitigation

Immediate Actions:

  1. Disable the Excerpt Highlights feature in Relevanssi settings until a patch is applied.
  2. Implement a Web Application Firewall (WAF) rule to block XSS payloads in search parameters.
  3. Restrict search functionality to authenticated users if possible.

Long-term Fix:

  • Apply the official patch from Relevanssi when released (monitor plugin updates).
  • Upgrade to a patched version (Free > 4.24.5 or Premium > 2.27.6).
  • Conduct a security audit of all WordPress plugins for similar vulnerabilities.

Workaround:

  • Use a security plugin like Wordfence to add input sanitization for search queries.
  • Manually edit the plugin file to add esc_html() around the query variable (not recommended for non-developers).

Valters IT
Securing Digital Frontiers

👁️ 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-5016/ · 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.