Skip to main content
Public proof of conceptFix available

CVE-2018-12895

A public proof of concept exists; no exploitation attested.

  • Published2018-06-26
  • Fixed in4.9.7
  • WeaknessCWE-22

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2018-06-2620:29CVE publishedNVD

Observed activity

isMalicious corpus · updated 2026-11-03 15:37 UTC
Indicators tagged with this CVE, per day0 indicators over 7 days
Block these indicators
  • Firewall list (EDL, text): https://api.ismalicious.com/edl/cve/CVE-2018-12895?format=txt
  • CSV export: https://api.ismalicious.com/edl/cve/CVE-2018-12895?format=csv
  • TAXII collection of exploited CVEs
  • The EDL and CSV take an API key on the Pro plan.

Versions per branch

NVD
WordPress
BranchAffectedFixed in
4.9< 4.9.74.9.7
Debian debian linux
BranchAffectedFixed in
8.0= 8.0no fix published
9.0= 9.0no fix published

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • wordpressUbuntu:18.04:LTSall versions · no fixed version listed
  • wordpressUbuntu:16.04:LTSall versions · no fixed version listed
  • wordpressDebian:14all versions · fixed in 4.9.7+dfsg1-1
  • wordpressDebian:13all versions · fixed in 4.9.7+dfsg1-1
  • wordpressDebian:12all versions · fixed in 4.9.7+dfsg1-1
  • wordpressDebian:9all versions · fixed in 4.7.5+dfsg-2+deb9u4
  • wordpressDebian:8all versions · fixed in 4.1+dfsg-1+deb8u18

Vendor advisories

  • CVE-2018-12895 Red Hat Product Security

    wordpress: Author users can execute arbitrary code by leveraging directory traversal on the wp-admin/post.php thumb parameter

Full record on NVD

Fix

  1. Update WordPress to 4.9.7

Detection

read 2026-11-02 22:42 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof-of-concept repositories
1 repository, unverifiedbloom-ux/cve-2018-12895-hotfix
PoC-in-GitHub
Metasploit modules
1 moduleauxiliary/scanner/http/wp_arbitrary_file_deletionrank: normalModule metadata: Metasploit Framework, © Rapid7, Inc., BSD-3-Clause.
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Published
2018-06-26
Last Modified
2026-06-17
NVD status
Modified

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.

Is CVE-2018-12895 actively exploited?

Active exploitation of CVE-2018-12895 has not been confirmed. Its EPSS score was 62.2% on 2026-11-03, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2018-12895?

CVE-2018-12895 has a CVSS v3 base score of 8.8 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.

Running WordPress? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record