Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2018-12895
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 06:32 UTC · Revision 1

Source evidence

CVE-2018-12895

core-osv · Original source

Published 26 Jun 2018, 20:29 UTC

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.

osv:CVE-2018-12895
Complete source record
{
  "id": "0381bb6e3ed18449aa8e9961a7c9530ae767fbc2c8cf425e5e658230563be0bb",
  "url": "https://osv.dev/vulnerability/CVE-2018-12895",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2018-12895",
    "summary": "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.",
    "evidence": "osv:CVE-2018-12895",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2018-12895",
      "aliases": [
        "CVE-2018-12895"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/wordpress/wordpress",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "d1802a68ec7a3536f744d45afb72660e4fef0292"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:wordpress:wordpress:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "4.9.7"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-12895.json"
          }
        },
        {
          "ranges": [
            {
              "repo": "https://github.com/wordpress/wordpress-develop",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "c561bbe127a7b92979e318b8a0f6a763e19e5108"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:wordpress:wordpress:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "4.9.7"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-12895.json"
          }
        }
      ],
      "modified": "2026-10-24T10:30:40.790931104Z",
      "provider": "osv",
      "references": [
        "https://blog.ripstech.com/2018/wordpress-file-delete-to-code-execution/",
        "https://lists.debian.org/debian-lts-announce/2018/07/msg00046.html",
        "https://wpvulndb.com/vulnerabilities/9100",
        "https://www.debian.org/security/2018/dsa-4250"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*",
              "cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"
            ],
            "vendor_product": "debian:debian_linux",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "8.0"
                  },
                  {
                    "last_affected": "8.0"
                  },
                  {
                    "introduced": "9.0"
                  },
                  {
                    "last_affected": "9.0"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2018-12895",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 435010,
  "published_at": "2018-06-26T20:29:00.273+00:00"
}