CVE-2024-7630
Executive Summary
CVE-2024-7630 is an information exposure vulnerability in the Relevanssi – A Better Search plugin for WordPress. The flaw exists in the relevanssi_do_query() function, which fails to properly restrict the posts returned during search operations. This allows unauthenticated attackers to extract potentially sensitive information from password-protected posts. The vulnerability affects all versions up to and including 4.22.2 (Free) and 2.25.1 (Premium). As a WordPress plugin vulnerability, this issue is specific to the WordPress ecosystem and does not involve Apache or Nginx.
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.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed through the official WordPress plugin repository and third-party marketplaces. The plugin is not available via NPM, PyPI, Go, or Ruby package managers. Users should verify the integrity of their plugin files by comparing checksums with the official repository and ensure they are not using modified or pirated versions.
CVSS Breakdown & Threat Level
- CVSS Score: 5.3 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: None (I:N)
- Availability Impact: None (A:N)
The low EPSS score (0.0%) suggests this vulnerability is not currently being actively exploited in the wild, but the potential for information disclosure from password-protected posts makes it a significant privacy concern.
Deep Dive & Mechanics
The vulnerability resides in the relevanssi_do_query() function, which is responsible for executing search queries and returning results. The function does not adequately filter out password-protected posts from search results. In WordPress, posts can be protected with a password, meaning their content should only be accessible to users who provide the correct password. However, due to insufficient limitations in the query logic, the search function may return excerpts, titles, or metadata from these protected posts to unauthenticated users.
The core issue is that the plugin's search query does not check the post_password field or apply the post_password_required() filter before including posts in the result set. This allows an attacker to craft search queries that reveal information from protected posts, such as:
- Post titles
- Post excerpts
- Custom fields
- Metadata
The attack is performed by sending a search request to the WordPress site's search endpoint. The plugin processes the query and returns results that may include password-protected posts, leaking sensitive information.
Vulnerable vs. Patched Code
Vulnerable Code (relevanssi_do_query function):
function relevanssi_do_query($query) {
// ... query building logic ...
$posts = get_posts($args);
// No check for password-protected posts
return $posts;
}
Patched Code (hypothetical fix):
function relevanssi_do_query($query) {
// ... query building logic ...
$args['post_password'] = ''; // Exclude password-protected posts
$posts = get_posts($args);
// Additional filtering
$filtered_posts = array_filter($posts, function($post) {
return !post_password_required($post);
});
return $filtered_posts;
}
The patched version adds a check to exclude posts that have a password set or that require a password to view. This ensures that only publicly accessible posts are returned in search results.
Exploitation & Lab Setup
Red Team
To exploit this vulnerability, an attacker would send a search query to the WordPress site's search endpoint. The following example demonstrates how to extract titles of password-protected posts:
curl -X GET "http://target-site.com/?s=password+protected&post_type=post"
If the site uses Relevanssi, the search results may include password-protected posts. The attacker can then iterate through search terms to discover more protected content.
Proof of Concept (Python):
import requests
target = "http://target-site.com"
search_terms = ["confidential", "secret", "protected", "internal"]
for term in search_terms:
response = requests.get(f"{target}/?s={term}")
if "password protected" in response.text.lower():
print(f"Found potential protected post with search term: {term}")
# Extract post titles
# ... parsing logic ...
Blue Team
To detect exploitation attempts, monitor for unusual search patterns, especially searches for terms like "password protected" or "confidential". Implement rate limiting on search endpoints and log all search queries for analysis.
Detection Steps:
- Monitor web server logs for repeated search queries with sensitive terms.
- Check for anomalies in search result counts (e.g., sudden increase in results).
- Use WAF rules to block search queries containing known sensitive keywords.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/?s=with unusual or sensitive search terms - Repeated search queries from the same IP address
- Search queries targeting specific post types or categories
- HTTP requests to
File IOCs:
- Modified
relevanssi.phporsearch.phpfiles in the plugin directory - Unauthorized changes to plugin configuration files
- Modified
Log IOCs:
- Web server logs showing search queries for "password protected" or similar terms
- Error logs indicating failed password attempts on protected posts
Detection Engineering
YARA Rule
rule CVE_2024_7630_Relevanssi_Info_Leak {
meta:
description = "Detects Relevanssi plugin files vulnerable to CVE-2024-7630"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-7630"
strings:
$vuln_func = "relevanssi_do_query"
$no_check = "post_password" nocase
$password_protected = "password" nocase
condition:
$vuln_func and not $no_check
}
Sigma Rule
title: CVE-2024-7630 Relevanssi Information Exposure Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential exploitation attempts of CVE-2024-7630 via search queries
author: Valters IT
date: 2024-01-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '?s='
keywords:
- 'password protected'
- 'confidential'
- 'secret'
- 'internal'
condition: selection and keywords
falsepositives:
- Legitimate searches for these terms
level: medium
Suricata Rule
alert http any any -> $HOME_NET any (
msg:"CVE-2024-7630 Relevanssi Information Exposure Attempt";
flow:to_server,established;
content:"?s=";
http_uri;
content:"password protected";
http_uri;
classtype:attempted-recon;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the Relevanssi plugin until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block search queries containing sensitive terms.
- Restrict search functionality to authenticated users only.
Long-term Fix:
- Apply the official patch from the vendor when released.
- Update to the latest version of Relevanssi (Free > 4.22.2, Premium > 2.25.1).
- Monitor the vendor's website for security updates.
Workarounds:
- Add custom code to filter out password-protected posts from search results.
- Use a different search plugin that properly handles post permissions.
- Implement server-side search restrictions using
.htaccessor Nginx configuration.
Detection:
- Enable detailed logging for search queries.
- Set up alerts for unusual search patterns.
- Regularly review web server logs for suspicious activity.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.