Thursday, March 27, 2025
HomeCVE/vulnerabilityWordPress Plugin Flaw Exposes 200,000+ Sites at Risk of Code Execution

WordPress Plugin Flaw Exposes 200,000+ Sites at Risk of Code Execution

Published on

SIEM as a Service

Follow Us on Google News

A critical security vulnerability has been discovered in the popular WordPress plugin, WP Ghost, which boasts over 200,000 active installations.

This flaw, tracked as CVE-2025-26909, concerns an unauthenticated Local File Inclusion (LFI) vulnerability that could potentially lead to Remote Code Execution (RCE) attacks on nearly all server environments.

The vulnerability has been addressed in the latest version of the plugin, with users urged to update to version 5.4.02 or later, as per a report by PatchStack.

Overview of the Vulnerability

The vulnerability affects how the plugin handles user input via URL paths for file inclusion. In specific cases, attackers can exploit this weakness to perform path traversal attacks, allowing them to include arbitrary files on the server.

This could lead to the execution of malicious code, particularly through techniques such as using php:// filter chains or exploiting PHP’s session upload progress features.

The vulnerability is traced to the showFile function located within models/Files.php, which fails to adequately sanitize and validate input URLs.

This oversight enables an attacker to manipulate the $new_path variable to point to any file on the server, bypassing security checks.

Here’s a snippet of the showFile function at the heart of the issue:

public function showFile( $url ) {
    // Initialize WordPress Filesystem
    $wp_filesystem = HMWP_Classes_ObjController::initFilesystem();
    // Remove the redirect hook
    remove_filter( 'wp_redirect', array( HMWP_Classes_ObjController::getClass( 'HMWP_Models_Rewrite' ), 'sanitize_redirect' ), PHP_INT_MAX );
    remove_filter( 'template_directory_uri', array( HMWP_Classes_ObjController::getClass( 'HMWP_Models_Rewrite' ), 'find_replace_url' ), PHP_INT_MAX );
    // In case of SAFE MODE URL or File mapping
    if ( HMW_DYNAMIC_FILES ) {
        $url = str_replace( $this->_safe_files, $this->_files, $url );
    }
    // Build the rewrite rules
    $this->buildRedirect();
    // Get the original URL and path based on rewrite rules
    $url_no_query = ( ( strpos( $url, '?' ) !== false ) ? substr( $url, 0, strpos( $url, '?' ) ) : $url );
    $new_url          = $this->getOriginalUrl( $url );
    $new_url_no_query = ( ( strpos( $new_url, '?' ) !== false ) ? substr( $new_url, 0, strpos( $new_url, '?' ) ) : $new_url );
    $new_path         = $this->getOriginalPath( $new_url );
    $ctype            = false;
    // Vulnerable code block
    } elseif (  stripos( trailingslashit( $url_no_query ), '/' . HMWP_Classes_Tools::getOption( 'hmwp_activate_url' ) . '/' ) !== false ) {
        header( "HTTP/1.1 200 OK" );
        ob_start();
        include $new_path; // This line is vulnerable due to lack of path validation
        $content = ob_get_clean();
        // Echo the html file content
        echo $content;
        die();
    }
}

Impact and Mitigation

  • User Action Required: Users of the WP Ghost plugin should update to version 5.4.02 immediately to protect their websites from potential attacks.
  • Protection for Patchstack Customers: If you are a Patchstack customer, your sites are already shielded from this vulnerability, requiring no additional steps.
  • Plugin Developers: Developers can leverage security audit services and the Enterprise API offered for hosting companies to enhance their plugin’s security posture.

The vendor has resolved the issue by adding rigorous validation checks on user-supplied URLs or paths.

The updated version of the plugin prevents the exploitation of this vulnerability by ensuring that only authorized paths are accessed.

This incident highlights the importance of strict validation and sanitization when handling user-provided data, especially in processes involving local file inclusion.

Ensuring that only whitelisted paths or files are accessible can significantly mitigate risks associated with such vulnerabilities.

Investigate Real-World Malicious Links & Phishing Attacks With Threat Intelligence Lookup - Try for Free

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Latest articles

CodeQLEAKED: GitHub Supply Chain Attack Enables Code Execution via CodeQL Repositories

A recent discovery has revealed a potential supply chain attack vulnerability in GitHub's CodeQL...

Exim Use-After-Free Vulnerability Enables Privilege Escalation

A significant security threat has been uncovered in Exim, a popular open-source mail transfer...

OpenAI Offers Up to $100,000 for Critical Infrastructure Vulnerability Reports

OpenAI has announced major updates to its cybersecurity initiatives. The company is expanding its...

Splunk RCE Vulnerability Enables Remote Code Execution via File Upload

A severe vulnerability in Splunk Enterprise and Splunk Cloud Platform has been identified, allowing...

Supply Chain Attack Prevention

Free Webinar - Supply Chain Attack Prevention

Recent attacks like Polyfill[.]io show how compromised third-party components become backdoors for hackers. PCI DSS 4.0’s Requirement 6.4.3 mandates stricter browser script controls, while Requirement 12.8 focuses on securing third-party providers.

Join Vivekanand Gopalan (VP of Products – Indusface) and Phani Deepak Akella (VP of Marketing – Indusface) as they break down these compliance requirements and share strategies to protect your applications from supply chain attacks.

Discussion points

Meeting PCI DSS 4.0 mandates.
Blocking malicious components and unauthorized JavaScript execution.
PIdentifying attack surfaces from third-party dependencies.
Preventing man-in-the-browser attacks with proactive monitoring.

More like this

CodeQLEAKED: GitHub Supply Chain Attack Enables Code Execution via CodeQL Repositories

A recent discovery has revealed a potential supply chain attack vulnerability in GitHub's CodeQL...

Exim Use-After-Free Vulnerability Enables Privilege Escalation

A significant security threat has been uncovered in Exim, a popular open-source mail transfer...

OpenAI Offers Up to $100,000 for Critical Infrastructure Vulnerability Reports

OpenAI has announced major updates to its cybersecurity initiatives. The company is expanding its...