PHP remote file inclusion vulnerability in config.inc.php in XZero Community Classifieds 4.95.11 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the path_escape parameter.
XZero Community Classifieds 4.95.11 and earlier are vulnerable to a remote file inclusion (RFI) attack. This allows attackers to execute arbitrary PHP code on the server by manipulating the path_escape parameter, potentially leading to complete system compromise and data breaches.
Step 1: Payload Preparation: The attacker crafts a malicious PHP script. This script could contain a web shell, reverse shell, or any other code designed to achieve the attacker's objectives (e.g., data exfiltration, privilege escalation).
Step 2: Payload Hosting: The malicious PHP script is hosted on a server controlled by the attacker. This server is accessible via a URL.
Step 3: Vulnerability Trigger: The attacker crafts a specially crafted URL targeting the vulnerable config.inc.php file. This URL includes the path_escape parameter, set to the URL of the attacker's malicious PHP script.
Step 4: Code Execution: The vulnerable application receives the malicious URL. The config.inc.php file, due to the lack of input validation, attempts to include the URL provided in the path_escape parameter.
Step 5: Control Achieved: The attacker's PHP script is executed on the server, granting the attacker control over the system.
The vulnerability stems from a failure to properly sanitize user-supplied input within the config.inc.php file. Specifically, the path_escape parameter, intended to define a file path, is directly used in an include or require statement without adequate validation. This allows an attacker to inject a URL pointing to a malicious PHP script hosted on a remote server. When the vulnerable application attempts to include this URL, the attacker's code is executed within the context of the web server, granting them control. The root cause is a lack of input validation and output encoding, allowing for the execution of arbitrary code. The use of include or require with unsanitized user input is the critical flaw.