CVE-2025-31045
Executive Summary
CVE-2025-31045 is a high-severity information disclosure vulnerability affecting the Elfsight Contact Form widget (WordPress plugin) versions up to and including 2.3.1. The flaw allows an unauthenticated attacker to retrieve embedded sensitive data from the server, such as API keys, database credentials, or internal configuration parameters, by exploiting the widget’s improper handling of user-supplied input. The vulnerability is classified under CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) and carries a CVSS v3.1 base score of 7.5 (High). No public exploit code or proof-of-concept is currently available, but the risk is elevated due to the lack of a vendor patch.
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 resides in a WordPress plugin ecosystem. The Elfsight Contact Form widget is distributed via the WordPress plugin repository and third-party marketplaces. Users who installed the plugin from unofficial sources may be at higher risk of supply chain compromise. No known malicious packages have been identified, but the absence of a patch increases the attack surface for supply chain attacks targeting WordPress sites.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – Exploit does not affect other components.
- Confidentiality (C): High (H) – Full disclosure of sensitive data.
- Integrity (I): None (N) – No data modification.
- Availability (A): None (N) – No denial of service.
Threat Level: High. The vulnerability is trivial to exploit and can lead to complete compromise of the WordPress site if sensitive credentials are exposed.
Deep Dive & Mechanics
The Elfsight Contact Form widget stores sensitive configuration data (e.g., API tokens, SMTP credentials, database connection strings) in a publicly accessible location or exposes them via an unauthenticated REST endpoint. The widget fails to validate or sanitize user input when processing requests to retrieve form settings, allowing an attacker to craft a request that dumps the entire configuration array.
The root cause is a missing capability check in the widget’s AJAX handler or shortcode processing logic. The widget likely uses wp_ajax_nopriv_* hooks without verifying user permissions, or it exposes a REST API endpoint that returns sensitive data without authentication.
Vulnerable vs. Patched Code
Vulnerable Code (<= 2.3.1):
// In elfsight-contact-form.php
add_action('wp_ajax_nopriv_elfsight_get_config', 'elfsight_get_config_callback');
function elfsight_get_config_callback() {
$config = get_option('elfsight_contact_form_config');
wp_send_json($config); // No permission check
}
Patched Code (Hypothetical):
add_action('wp_ajax_elfsight_get_config', 'elfsight_get_config_callback');
function elfsight_get_config_callback() {
if (!current_user_can('manage_options')) {
wp_die('Unauthorized', 403);
}
$config = get_option('elfsight_contact_form_config');
wp_send_json($config);
}
The patch removes the nopriv hook and adds a capability check to ensure only administrators can access the configuration.
Exploitation & Lab Setup
Red Team (Exploitation)
- Reconnaissance: Identify WordPress sites using the Elfsight Contact Form widget (e.g., via Shodan dorks or WPScan).
- Craft Request: Send a GET request to the vulnerable endpoint:
GET /wp-admin/admin-ajax.php?action=elfsight_get_config HTTP/1.1 Host: target.com - Extract Data: The response will contain the full configuration array, including API keys, SMTP credentials, and database passwords.
Example cURL command:
curl -s "http://target.com/wp-admin/admin-ajax.php?action=elfsight_get_config" | jq .
Blue Team (Detection & Response)
- Monitor Logs: Look for repeated requests to
/wp-admin/admin-ajax.phpwithaction=elfsight_get_configfrom unknown IPs. - Harden Endpoint: Immediately disable the vulnerable AJAX action by adding a filter:
add_filter('pre_option_elfsight_contact_form_config', '__return_empty_string'); - Rotate Credentials: If exposed, rotate all API keys, SMTP passwords, and database credentials.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/wp-admin/admin-ajax.php?action=elfsight_get_config - Response bodies containing JSON with keys like
api_key,smtp_password,db_password
- HTTP requests to
- File IOCs:
- Presence of
elfsight-contact-form/elfsight-contact-form.phpwith version <= 2.3.1
- Presence of
- Log IOCs:
- Unusual 200 responses to
admin-ajax.phpfrom unauthenticated users
- Unusual 200 responses to
Detection Engineering
YARA Rule
rule detect_elfsight_contact_form_vuln {
meta:
description = "Detects vulnerable Elfsight Contact Form widget version <= 2.3.1"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-31045"
strings:
$version = "Version: 2.3.1" nocase
$func = "elfsight_get_config_callback" nocase
condition:
$func and $version
}
Sigma Rule
title: Detect Exploitation of CVE-2025-31045
id: 8a7b3c2d-1e4f-5a6b-7c8d-9e0f1a2b3c4d
status: experimental
description: Detects attempts to exploit the Elfsight Contact Form information disclosure vulnerability
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
c-uri|contains: '/wp-admin/admin-ajax.php'
cs-uri-query|contains: 'action=elfsight_get_config'
condition: selection
falsepositives:
- Legitimate admin requests (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-31045 - Elfsight Contact Form Information Disclosure"; flow:to_server; content:"GET"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=elfsight_get_config"; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the Elfsight Contact Form widget until a patch is released.
- Workaround: Add a custom filter to block the vulnerable AJAX action:
add_action('init', function() { if (isset($_GET['action']) && $_GET['action'] === 'elfsight_get_config') { wp_die('Access denied', 403); } }); - Long-term: Monitor the vendor’s website for a patched version (>= 2.3.2). Apply the update as soon as it becomes available.
- Credential Rotation: Rotate all secrets that may have been exposed (API keys, SMTP passwords, database credentials).
- Web Application Firewall (WAF): Deploy a WAF rule to block requests containing
action=elfsight_get_config.
Valters IT
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.