WordPress Core < 4.9.7 - Authenticated Arbitrary File Deletion

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CVE CVE-2018-12895
CVSS High (8.8)
Publicly Published July 5, 2018
Last Updated January 22, 2024
Researcher Matt Barry, Karim El Ouerghemmi, Slavco Mihajloski
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.

References

1 affected software package

Software Type Core
Software Slug wordpress (view on wordpress.org)
Patched? Yes
Affected Version
  • <= 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
Patched 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
This record contains material that is subject to copyright

Copyright 2012-2026 Defiant Inc.
License: Defiant hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute this software vulnerability information. Any copy of the software vulnerability information you make for such purposes is authorized provided that you include a hyperlink to this vulnerability record and reproduce Defiant's copyright designation and this license in any such copy. License Detail.