On WordPress versions 5.0.0 and <= 4.9.8 it is possible to gain arbitrary code execution via a core vulnerability combining a Path Traversal and a Local File Inclusion.
An attacker who gains access to an account with at least author privileges on the target can execute PHP code on the remote server.
## Exploitation Steps
1. Upload an image containing PHP code
2. Edit the `_wp_attached_file` entry from `meta_input` $_POST array to specify an arbitrary path
3. Perform the Path Traversal by using the `crop-image` Wordpress function
4. Perform the Local File Inclusion by creating a new WordPress post and set `_wp_page_template` value to the cropped image. The post will `include()` our image containing PHP code.
When visiting the post created by the attacker it is possible to obtain code execudion.
More details can be found on [RIPS Technology Blog](https://blog.ripstech.com/2019/wordpress-image-remote-code-execution/).