Local File Inclusion (LFI)
Introduction
This article covers cases of possible LFI on WordPress. This includes improper file inclusion inside of the plugin/theme which can be used to gain RCE on the server.
Useful Functions
Several functions could be useful to identify a possible LFI vulnerability:
Example Cases
Below is an example of vulnerable code:
To exploit this, any unauthenticated user just needs to perform a POST request to the /wp-admin/admin-ajax.php
endpoint specifying the needed parameter to trigger the include
function.
Below are some of the findings related to Local File Inclusion: