Skip to main content
Vulnerability Database/CVE-2012-20002

CVE-2012-20002: TinyMCE Gallery Path Traversal Vulnerability

CVE-2012-20002 is a path traversal flaw in TinyMCE Thumbnail Gallery plugin for WordPress that lets unauthenticated attackers read sensitive files like wp-config.php. This article covers technical details, exploitation methods, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2012-20002 Overview

CVE-2012-20002 is a path traversal vulnerability [CWE-22] in the TinyMCE Thumbnail Gallery plugin for WordPress versions prior to 1.1.0. Unauthenticated attackers can read arbitrary files on the WordPress host by abusing the href parameter of the /php/download-image.php endpoint. Submitting traversal sequences such as ../../../../wp-config.php returns the targeted file contents, which exposes database credentials, authentication keys, and other sensitive configuration data. The Shadowserver Foundation first observed in-the-wild exploitation attempts on 2023-10-19, and public exploit code has been available via Exploit-DB and Packet Storm for over a decade.

Critical Impact

Unauthenticated remote attackers can retrieve wp-config.php and recover WordPress database credentials, enabling full site compromise.

Affected Products

  • WordPress TinyMCE Thumbnail Gallery plugin versions prior to 1.1.0
  • WordPress sites with the plugin installed and the /php/download-image.php script reachable
  • Any WordPress deployment where the plugin remains active regardless of the host operating system

Discovery Timeline

  • 2023-10-19 - Shadowserver Foundation first observes in-the-wild exploitation
  • 2026-10-20 - CVE-2012-20002 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2012-20002

Vulnerability Analysis

The plugin ships a PHP handler at /php/download-image.php that accepts a user-controlled href parameter and returns the file located at that path. The handler fails to canonicalize the input or restrict it to the plugin's media directory. Attackers can therefore append ../ sequences to escape the intended directory and read any file the web server process can access.

The weakness is classified as path traversal [CWE-22]. Successful exploitation discloses WordPress secrets stored in wp-config.php, including DB_USER, DB_PASSWORD, AUTH_KEY, and related salts. With database credentials exposed, an attacker can authenticate directly to MySQL where it is reachable, or forge session cookies to impersonate administrators and achieve persistence.

Root Cause

The root cause is missing input validation on the href request parameter. The PHP script concatenates attacker-supplied data into a filesystem path and passes it to a file-read function without sanitization, allowlist checks, or realpath() containment.

Attack Vector

Exploitation requires a single unauthenticated HTTP GET request to the vulnerable endpoint. An attacker issues a request such as GET /wp-content/plugins/tinymce-thumbnail-gallery/php/download-image.php?href=../../../../wp-config.php and receives the raw file contents in the response body. The attack requires no user interaction and no credentials, and it can be delivered at scale with automation tooling such as the publicly available Nuclei template referenced below.

See the GitHub Nuclei Template, Exploit-DB #19022, and the VulnCheck Advisory: TinyMCE Path Traversal for technical reproduction details.

Detection Methods for CVE-2012-20002

Indicators of Compromise

  • HTTP requests to /wp-content/plugins/tinymce-thumbnail-gallery/php/download-image.php containing href= parameters with ../ or URL-encoded %2e%2e%2f sequences
  • Web server access logs showing responses that return wp-config.php, /etc/passwd, or other sensitive paths through the plugin endpoint
  • Unexpected outbound database connections from new IP addresses following suspected credential exposure

Detection Strategies

  • Deploy the public Nuclei template wp-tinymce-lfi.yaml from the ProjectDiscovery repository against perimeter WordPress assets to identify vulnerable installations.
  • Build web application firewall rules that match the plugin path combined with traversal patterns in the href query string.
  • Correlate successful 200 responses on download-image.php with abnormal response sizes that indicate file content exfiltration rather than image data.

Monitoring Recommendations

  • Alert on any read access to wp-config.php by the web server process outside of normal WordPress bootstrap behavior.
  • Monitor WordPress plugin inventories for installations of TinyMCE Thumbnail Gallery and flag versions below 1.1.0.
  • Track MySQL authentication events for the WordPress database user from unexpected source IPs after any confirmed exploitation attempt.

How to Mitigate CVE-2012-20002

Immediate Actions Required

  • Upgrade the TinyMCE Thumbnail Gallery plugin to version 1.1.0 or later, or uninstall it if no longer required.
  • Rotate all secrets stored in wp-config.php, including database credentials and WordPress authentication keys and salts.
  • Review web server access logs since 2023-10-19 for exploitation attempts against /php/download-image.php.

Patch Information

The plugin maintainer addressed the issue in version 1.1.0. Confirm the running version through the WordPress plugin administration interface or by inspecting the plugin header in tinymce-thumbnail-gallery.php. Patch metadata is tracked in the WPScan Vulnerability Report #4a49b023 and the WordPress Plugin: TinyMCE Thumbnail Gallery listing.

Workarounds

  • Block external requests to /wp-content/plugins/tinymce-thumbnail-gallery/php/download-image.php at the web server or WAF layer until patching is complete.
  • Deny filesystem read access to wp-config.php for the PHP worker process beyond initial WordPress load through filesystem ACLs or open_basedir restrictions.
  • Place the WordPress database on a private network segment that rejects connections from untrusted sources even if credentials leak.
bash
# Example nginx rule to block exploitation attempts
location ~* /wp-content/plugins/tinymce-thumbnail-gallery/php/download-image\.php {
    return 403;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.