CVE-2025-31076
Executive Summary
CVE-2025-31076 is a Server-Side Request Forgery (SSRF) vulnerability in the WP Compress for MainWP WordPress plugin, affecting versions up to and including 6.30.03. This flaw allows an authenticated attacker with low privileges to make the server send crafted requests to internal or external resources, potentially leading to information disclosure or internal network reconnaissance. The vulnerability is currently unpatched, and no public proof-of-concept (PoC) or exploit code has been released. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains significant for WordPress sites using this plugin.
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. As a supply chain risk, any site using the WP Compress for MainWP plugin version <= 6.30.03 is vulnerable. Administrators should monitor for updates and consider disabling the plugin until a patch is available.
CVSS Breakdown & Threat Level
- CVSS Score: 4.9 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (authenticated user)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: Low (potential internal data exposure)
- Integrity Impact: None
- Availability Impact: None
The medium severity reflects the low barrier to exploitation (authenticated user) but limited direct impact (information disclosure). However, SSRF can be chained with other vulnerabilities for more severe attacks.
Deep Dive & Mechanics
The vulnerability resides in the WP Compress for MainWP plugin's handling of user-supplied URLs or parameters that are used to make server-side HTTP requests. The plugin fails to properly validate or sanitize these inputs, allowing an attacker to specify arbitrary destinations (e.g., internal IP addresses, cloud metadata endpoints). When the server processes the request, it forwards the request to the attacker-controlled target, potentially leaking sensitive information.
Root Cause: Lack of input validation and URL whitelisting in the plugin's HTTP request functionality. The plugin likely uses functions like wp_remote_get() or curl without restricting the target host.
Attack Scenario:
- An attacker with a low-privilege account (e.g., subscriber) on a WordPress site with the vulnerable plugin.
- The attacker crafts a malicious request to the plugin's endpoint, specifying an internal IP (e.g.,
http://169.254.169.254/latest/meta-data/for AWS metadata). - The server executes the request and returns the response to the attacker, exposing cloud instance metadata (e.g., IAM credentials).
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code pattern. The vulnerable code likely resembles:
// Vulnerable code (conceptual)
function wp_compress_fetch_url($url) {
$response = wp_remote_get($url); // No validation
return wp_remote_retrieve_body($response);
}
A patched version would include URL validation:
// Patched code (conceptual)
function wp_compress_fetch_url($url) {
$allowed_hosts = array('api.wpcompress.com', 'cdn.wpcompress.com');
$parsed_url = parse_url($url);
if (!in_array($parsed_url['host'], $allowed_hosts)) {
return new WP_Error('invalid_url', 'URL not allowed');
}
$response = wp_remote_get($url);
return wp_remote_retrieve_body($response);
}
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- WordPress site with WP Compress for MainWP <= 6.30.03
- Low-privilege user account (e.g., subscriber)
- Internal network access (or ability to reach cloud metadata)
Exploitation Steps:
- Identify the vulnerable endpoint (e.g.,
/wp-admin/admin-ajax.php?action=wp_compress_fetch). - Craft a request with a malicious URL:
POST /wp-admin/admin-ajax.php HTTP/1.1 Host: target-wordpress-site.com Content-Type: application/x-www-form-urlencoded action=wp_compress_fetch&url=http://169.254.169.254/latest/meta-data/iam/security-credentials/admin - The server will fetch the AWS metadata and return it in the response.
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team (Defensive)
Detection Steps:
- Monitor for outbound HTTP requests to internal IP ranges (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.169.254).
- Review WordPress access logs for suspicious
admin-ajax.phprequests withurlparameters containing internal IPs. - Implement network segmentation to restrict outbound traffic from web servers.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to internal IP addresses (e.g., 10.x.x.x, 172.16.x.x, 192.168.x.x, 169.254.169.254)
- Requests to cloud metadata endpoints (e.g.,
http://169.254.169.254/)
- File IOCs:
- Modified plugin files in
/wp-content/plugins/wp-compress-mainwp/
- Modified plugin files in
- Log IOCs:
- WordPress debug logs showing failed URL validation
- Web server logs with
admin-ajax.phprequests containing suspiciousurlparameters
Detection Engineering
YARA Rule
rule CVE_2025_31076_SSRF_WP_Compress {
meta:
description = "Detects SSRF exploitation attempts against WP Compress for MainWP"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-31076"
strings:
$url_param = "url=" nocase
$internal_ip = /(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3}|169\.254\.\d{1,3}\.\d{1,3})/
$metadata = "169.254.169.254" nocase
condition:
$url_param and ($internal_ip or $metadata)
}
Sigma Rule
title: CVE-2025-31076 SSRF via WP Compress for MainWP
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SSRF exploitation attempts against WP Compress for MainWP plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'admin-ajax.php'
cs-uri-query|contains: 'action=wp_compress_fetch'
cs-uri-query|contains|all:
- 'url=http://'
- '169.254.169.254'
condition: selection
falsepositives:
- Legitimate plugin functionality (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-31076 SSRF WP Compress for MainWP"; flow:to_server,established; content:"POST"; http_method; content:"admin-ajax.php"; http_uri; content:"action=wp_compress_fetch"; http_client_body; content:"url="; http_client_body; pcre:"/url=http:\/\/169\.254\.169\.254\//Ri"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- If disabling is not possible, restrict access to the plugin's functionality via
.htaccessor web application firewall (WAF) rules. - Implement network-level controls to block outbound requests to internal IP ranges from the web server.
Long-term Fix:
- Apply the official patch once released by the vendor.
- Consider replacing the plugin with an alternative that has proper input validation.
WAF Rule (ModSecurity):
SecRule REQUEST_URI "@contains admin-ajax.php" "chain,id:1000002,deny,msg:'CVE-2025-31076 SSRF attempt'"
SecRule ARGS:url "@rx ^http://(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|169\.254\.)" "t:lowercase"
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
Report generated for CVE-2025-31076
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.