CVE-2018-12895

CVE-2018-12895 is a high-severity vulnerability in Wordpress with a CVSS 3.x base score of 8.8. Its EPSS exploit-prediction score of 63% places it in the 99th percentile, indicating an elevated likelihood of exploitation. The underlying weakness is classified as CWE-22.

Key facts

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.

Frequently asked questions

What is CVE-2018-12895?
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.
How severe is CVE-2018-12895?
CVE-2018-12895 has a CVSS 3.x base score of 8.8, rated high severity. It is exploitable over network with low attack complexity, requires low privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
Is CVE-2018-12895 being actively exploited?
It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 63% (99th percentile), an estimate of the probability of exploitation in the next 30 days.
What products are affected by CVE-2018-12895?
CVE-2018-12895 primarily affects Wordpress. In total, 3 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
How do I fix CVE-2018-12895?
Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
When was CVE-2018-12895 published?
CVE-2018-12895 was published on 2018-06-26 and last updated on 2026-06-17.

References

Affected products (3)

More vulnerabilities in Wordpress

All CVEs affecting Wordpress →

Other CWE-22 (Path Traversal) vulnerabilities

Browse all CWE-22 (Path Traversal) vulnerabilities →