Atomic Edge analysis of CVE-2026-54814:
This vulnerability allows authenticated users with subscriber-level access or higher to perform a Local File Inclusion (LFI) attack against the Motors – Car Dealership & Classified Listings Plugin for WordPress, up to version 1.4.109. The vulnerability resides in the template loading mechanism used throughout the plugin, specifically in the stm_listings_locate_template() and stm_listings_load_template() functions found in includes/templates.php. The flaw enables an attacker to include arbitrary PHP files from the server, leading to code execution, data exfiltration, or access control bypass.
Root Cause: The stm_listings_locate_template() function in includes/templates.php lacked any validation of the $template parameter, allowing path traversal sequences like ‘..’ and absolute paths. The function also did not sanitize the $template value before passing it to file_exists() or realpath(), meaning an attacker could traverse outside the intended templates directory. In the user-facing page rendering flow (templates/user/private/user.php at lines 10-55), the $tpl variable derived from $_GET[‘page’] was sanitized with sanitize_text_field, which does not block path traversal sequences. Within the stm_listings_locate_template function, the template path was prepended with the plugin’s template base directory, but an attacker could break out using ‘../’ or absolute paths. The patched code added a new function stm_listings_is_safe_template_path() (line 52 of diff) that explicitly blocks directory traversal (‘..’), protocol wrappers (php://, file://), null bytes, and schemes, ensuring only relative paths within the templates directory are processed.
Exploitation: An attacker, authenticated as a subscriber or higher, crafts a GET request to the user’s private dashboard page at /wp-content/plugins/motors-car-dealership-classified-listings/templates/user/private/user.php?page=../../../etc/passwd or similar path traversal payload. The vulnerable code path in user.php retrieves the ‘page’ parameter via $_GET[‘page’] and passes it to do_action(‘stm_listings_load_template’, $path . $_GET[‘page’]), which concatenates the attacker-supplied value with the legitimate template directory path. The stm_listings_load_template function calls stm_listings_locate_template without validation, allowing arbitrary file inclusion. File inclusion can use PHP wrappers (php://filter/convert.base64-encode/resource=…) to read sensitive files, or if an attacker can upload a ‘safe’ file (e.g., image with embedded PHP), the inclusion leads to RCE.
Patch Analysis: The patch introduces multiple complementary defenses. First, the stm_listings_is_safe_template_path() function (added in includes/templates.php) validates that the template path contains no directory traversal (..), no null bytes, no protocol schemes (like php://), and no absolute paths. Second, the stm_listings_locate_template function now calls this validator and skips any unsafe template. It also normalizes the path (converting backslashes, stripping leading slashes) and uses realpath() on both the base directory and the full path to ensure the resolved path stays within the expected base directory (validated via strpos check against the base path). Third, the allowed pages list is strictly whitelisted in user.php (line 10-19) to only include specific safe page names: ‘inventory’, ‘favourite’, ‘settings’, ‘become-dealer’, ‘car-edit’, ‘password-recovery’. The $tpl variable is now sanitized with sanitize_key(), which strips all non-alphanumeric characters except underscores and dashes. The in_array() check ensures only whitelisted pages load templates. This eliminates the possibility of an attacker passing arbitrary ‘page’ values.
Impact: Successful exploitation allows an authenticated attacker to include arbitrary files from the WordPress server, enabling remote code execution if PHP files with embedded PHP can be included (e.g., uploaded media files, log files, or other safe file types that contain PHP code). This can lead to complete site compromise, data theft, privilege escalation to admin, and backdoor installation. The CVSS score of 7.5 indicates high severity due to the low barrier of entry (subscriber-level access) and potential for full system takeover.

