Affected versions
- Affected versions
- <3.7 || >=3.7 <=3.7.26 || >=3.8 <=3.8.26 || >=3.9 <=3.9.24 || >=4.0 <=4.0.23 || >=4.1 <=4.1.23 || >=4.2 <=4.2.20 || >=4.3 <=4.3.16 || >=4.4 <=4.4.15 || >=4.5 <=4.5.14 || >=4.6 <=4.6.11 || >=4.7 <=4.7.10 || >=4.8 <=4.8.6 || >=4.9 <=4.9.6
- Fixed version
- 3.7.27 · 3.8.27 · 3.9.25 · 4.0.24 · 4.1.24 · 4.2.21 · 4.3.17 · 4.4.16 · 4.5.15 · 4.6.12 · 4.7.11 · 4.8.7 · 4.9.7
Exploitation
Description
WordPress through 4.9.6 allows Author users to execute arbitrary code by leveraging directory traversal in the wp-admin/post.php thumb parameter, which is passed to the PHP unlink function and can delete the wp-config.php file. This is related to missing filename validation in the wp-includes/post.php wp_delete_attachment function. The attacker must have capabilities for files and posts that are normally available only to the Author, Editor, and Administrator roles. The attack methodology is to delete wp-config.php and then launch a new installation process to increase the attacker's privileges.
Links
Credits
- Matt Barry
- Karim El Ouerghemmi
- Slavco Mihajloski

