WordPress Core < 4.9.7 - Authenticated Arbitrary File Deletion

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

Share

1 affected software package

Software Type Core
Patched? Yes
Remediation Update to one of the following versions, or a newer 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
Affected Versions
  • < 3.7
  • 4.8 - 4.8.6
  • 4.9 - 4.9.6
  • 3.7 - 3.7.26
Expand to see 10 more affected version ranges.
  • 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
Patched Versions
  • 3.7.27
  • 3.8.27
  • 3.9.25
  • 4.0.24
Expand to see 9 more patched versions.
  • 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

Did you know Wordfence Intelligence provides free personal and commercial API access to our comprehensive WordPress vulnerability database, along with a free webhook integration to stay on top of the latest vulnerabilities added and updated in the database? Get started today!

Learn more

Want to get notified of the latest vulnerabilities that may affect your WordPress site?
Install Wordfence on your site today to get notified immediately if your site is affected by a vulnerability that has been added to our database.

Get Wordfence

The Wordfence Intelligence WordPress vulnerability database is completely free to access and query via API. Please review the documentation on how to access and consume the vulnerability data via API.

Documentation