← Vulnerability feed

Vulnerability record · CVE-2018-12895 · published 26 June 2018

CVE-2018-12895: WordPress Author role path traversal enables arbitrary file deletion and code execution

Wordpress · Wordpress

WordPress through 4.9.6 fails to validate filenames in the wp_delete_attachment function in wp-includes/post.php, so the thumb parameter in wp-admin/post.php is passed to PHP unlink without sanitization. An authenticated Author can use directory traversal to delete arbitrary files, notably wp-config.php, and then trigger a fresh installation to gain higher privileges. The flaw matters because a low-privilege content role can escalate to full site compromise.

8.8 CVSS 3.1 High EPSS 62% · top 0.8% CWE-22 · Path traversal
8.8CVSS 3.1 base score, v2 6.5
62%EPSS exploitation probability, 30 days
NoNot in CISA KEV
2Affected product versions listed by NVD
12References, 2 tagged exploit
17 Jun 2026Last modified by NVD

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.

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 19 September 2026. Confidence: high.

high priorityCVSS 8.8 with low privileges required and public exploit code, though it needs an authenticated Author account and is not in KEV.

What it is

WordPress through 4.9.6 fails to validate filenames in the wp_delete_attachment function in wp-includes/post.php, so the thumb parameter in wp-admin/post.php is passed to PHP unlink without sanitization. An authenticated Author can use directory traversal to delete arbitrary files, notably wp-config.php, and then trigger a fresh installation to gain higher privileges. The flaw matters because a low-privilege content role can escalate to full site compromise.

Impact

An attacker with Author-level access can delete arbitrary files on the server and, by removing wp-config.php and rerunning the installer, take over the WordPress site and execute code.

Attack surface

Reached over the network through the WordPress admin interface (wp-admin/post.php) with the thumb parameter; the attacker must be authenticated with at least Author capabilities for files and posts, and no user interaction is required.

Exploitation

Not listed in CISA KEV, but EPSS is 0.62162 (99.1st percentile) and public references carry an Exploit tag, indicating a working exploit is publicly available.

What to do

  • Upgrade WordPress to a version after 4.9.6 that includes filename validation in wp_delete_attachment.
  • Apply the Debian security update DSA-4250 or the corresponding LTS announcement for packaged installs.
  • Restrict Author and Editor accounts to trusted users and audit role assignments.
  • Harden wp-config.php with restrictive file permissions and consider moving it outside the web root.
  • Monitor for unexpected re-runs of the WordPress installation process.

Detection

  • Alert on requests to wp-admin/post.php with a thumb parameter containing traversal sequences such as ../.
  • Monitor file system events for deletion of wp-config.php or other files outside the uploads directory.
  • Detect access to install.php or setup-config.php on an already-installed site.
  • Review web server logs for Author-role accounts performing attachment deletion actions.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2018-12895 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-63030WordPress REST API route confusion leads to SQL injection and RCEWordPress 6.9.x before 6.9.5 and 7.0.x before 7.0.2 contain a REST API batch endpoint route confusion flaw (CWE-436). Chained with the author__not_in…KEVEPSS 10%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed

Source: NIST National Vulnerability Database (record CVE-2018-12895), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.