Saturday, May 3, 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.

- Advertisement - Google News

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

Hundreds of Fortune 500 Companies Have Unknowingly Employed North Korean IT Operatives

North Korean nationals have successfully infiltrated the employee ranks of major global corporations at...

Stealthy New NodeJS Backdoor Infects Users Through CAPTCHA Verifications

Security researchers have uncovered a sophisticated malware campaign utilizing fake CAPTCHA verification screens to...

State-Sponsored Hacktivism on the Rise, Transforming the Cyber Threat Landscape

Global cybersecurity landscape is undergoing a significant transformation, as state-sponsored hacktivism gains traction amid...

NVIDIA Riva AI Speech Flaw Let Hackers Gain Unauthorized Access to Abuse GPU Resources & API keys

Researchers have uncovered significant security vulnerabilities in NVIDIA Riva, a breakthrough AI speech technology...

Resilience at Scale

Why Application Security is Non-Negotiable

The resilience of your digital infrastructure directly impacts your ability to scale. And yet, application security remains a critical weak link for most organizations.

Application Security is no longer just a defensive play—it’s the cornerstone of cyber resilience and sustainable growth. In this webinar, Karthik Krishnamoorthy (CTO of Indusface) and Phani Deepak Akella (VP of Marketing – Indusface), will share how AI-powered application security can help organizations build resilience by

Discussion points


Protecting at internet scale using AI and behavioral-based DDoS & bot mitigation.
Autonomously discovering external assets and remediating vulnerabilities within 72 hours, enabling secure, confident scaling.
Ensuring 100% application availability through platforms architected for failure resilience.
Eliminating silos with real-time correlation between attack surface and active threats for rapid, accurate mitigation

More like this

Hundreds of Fortune 500 Companies Have Unknowingly Employed North Korean IT Operatives

North Korean nationals have successfully infiltrated the employee ranks of major global corporations at...

State-Sponsored Hacktivism on the Rise, Transforming the Cyber Threat Landscape

Global cybersecurity landscape is undergoing a significant transformation, as state-sponsored hacktivism gains traction amid...

Stealthy New NodeJS Backdoor Infects Users Through CAPTCHA Verifications

Security researchers have uncovered a sophisticated malware campaign utilizing fake CAPTCHA verification screens to...