The ElementsKit Elementor addons plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 3.0.6 via the render_raw function. This makes it possible for authenticated attackers, with contributor-level access and above, to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where images and other “safe” file types can be uploaded and included.
Intercept the request in BurpSuite and we see the data for ekit_testimonial_style is being sent over with a value style1
We create a dummy file in the root folder called a.php with the following contents
<?php echo system('whoami') ?>
Now we modify the value of ekit_testimonial_style to ../../../a.php and see the PHP file being executed, and returns the host name of our machine
Fixed Version
After we update the plugin to it’s latest version and send the traffic again, there is no more directory traversal because ../../../a.php is not in the array
Also, they kinda fixed type juggling in PHP 8, so in_array is pretty safe now!