Cyber Security News

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

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 is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Gamaredon Hackers Weaponize LNK Files to Deliver Remcos Backdoor

Cisco Talos has uncovered an ongoing cyber campaign by the Gamaredon threat actor group, targeting…

1 day ago

“Crocodilus” A New Malware Targeting Android Devices for Full Takeover

Researchers have uncovered a dangerous new mobile banking Trojan dubbed Crocodilus actively targeting financial institutions…

1 day ago

SquareX Discloses Browser-Native Ransomware that Puts Millions at Risk

From WannaCry to the MGM Resorts Hack, ransomware remains one of the most damaging cyberthreats…

2 days ago

Hackers Exploit DNS MX Records to Create Fake Logins Imitating 100+ Brands

Cybersecurity researchers have discovered a sophisticated phishing-as-a-service (PhaaS) platform, dubbed "Morphing Meerkat," that leverages DNS…

2 days ago

New Python-Based Discord RAT Targets Users to Steal Login Credentials

A recently identified Remote Access Trojan (RAT) has raised alarms within the cybersecurity community due…

2 days ago

PJobRAT Android Malware Masquerades as Dating and Messaging Apps to Target Military Personnel

PJobRAT, an Android Remote Access Trojan (RAT) first identified in 2019, has resurfaced in a…

2 days ago