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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | wordpress | 4.9.7+dfsg1-1 | — |
| Debian 13 | wordpress | 4.9.7+dfsg1-1 | — |
| Debian 12 | wordpress | 4.9.7+dfsg1-1 | — |
| Debian 9 | wordpress | 4.7.5+dfsg-2+deb9u4 | DSA-4250-1 |
| Debian 8 | wordpress | 4.1+dfsg-1+deb8u18 | DLA-1452-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | wordpress | No fix yet | — |
| Ubuntu 16.04 LTS | wordpress | No fix yet | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
Wordpress Arbitrary File Deletion
auxiliary/scanner/http/wp_arbitrary_file_deletion
GitHub 1 repository
-
bloom-ux/cve-2018-12895-hotfix ★ 0 · Jul 5, 2018
Hotfix for file deletion to to code execution vulnerability in WordPress
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 2
- DSA-4250-1 wordpress - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-1452-1 wordpress - security update Debian Security (DSA / DLA) · Mar 9, 2026
References
- https://blog.ripstech.com/2018/wordpress-file-delete-to-code-execution/
- 104569 vdb-entry
- DSA-4250 vendor-advisory
- https://wpvulndb.com/vulnerabilities/9100
- [debian-lts-announce] 20180730 [SECURITY] [DLA 1452-1] wordpress security update mailing-list
- http://packetstormsecurity.com/files/164633/WordPress-4.9.6-Arbitrary-File-Deletion.html