CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2025-48940
7.20.13%

MyBB Upgrade Module Local File Inclusion

Alon Barad
Alon Barad
Software Engineer

Feb 28, 2026·5 min read·2 visits

PoC Available

Executive Summary (TL;DR)

MyBB versions before 1.8.39 contain a Local File Inclusion vulnerability in the upgrade wizard. Attackers with access to the installation script (admins or uninstalled instances) can manipulate the 'action' parameter to execute arbitrary local files.

A high-severity Local File Inclusion (LFI) vulnerability has been identified in the upgrade component of MyBB, a popular open-source forum software. The flaw resides in the `install/upgrade.php` script, where insufficient input validation on the `action` parameter allows attackers to traverse directories and include arbitrary PHP files. This vulnerability affects all MyBB versions prior to 1.8.39. Successful exploitation can lead to Remote Code Execution (RCE) if the attacker can upload or control a file on the disk, or significant information disclosure depending on the server configuration.

Vulnerability Overview

A path traversal vulnerability exists in the upgrade mechanism of MyBB, specifically within the install/upgrade.php script. This component is responsible for handling database schema updates and version migration tasks during the software's installation or upgrade process. The vulnerability stems from improper handling of the action HTTP parameter, which determines which upgrade module to load.

The application fails to adequately sanitize user-supplied input before using it to construct a file path for inclusion. By manipulating this parameter, an attacker can break out of the intended directory structure (install/modules/) and point the application to files located elsewhere on the server. While the inclusion logic appends a .php extension to the file path, this still permits the execution of any PHP file accessible to the web server user.

Access to the vulnerable script is typically restricted by the presence of an install/lock file in a production environment. However, if this file is missing, or if the attacker possesses administrative credentials to bypass the lock check, the vulnerability becomes exploitable. This flaw is tracked as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).

Root Cause Analysis

The root cause of CVE-2025-48940 lies in the logic used to parse the action parameter in install/upgrade.php. The application intends to split this parameter into a module name and an operation. The parsing logic uses the PHP explode function with an underscore delimiter to separate these components.

The code blindly trusts the first segment of the exploded string ($bits[0]) and assigns it to the variable $from. This variable is subsequently passed to the next_function(), which is responsible for loading the appropriate upgrade module. Crucially, there was no validation to ensure $from contained only safe characters (such as alphanumeric characters) before it was used in a file path.

Inside next_function(), the application constructs a path using the pattern "upgrade" . $from . ".php" and passes this string to a custom load_module() function. Because $from is user-controlled and unvalidated, an attacker can inject directory traversal sequences (e.g., ../../) to navigate out of the install/modules directory. The lack of a whitelist or a sanitization routine for directory separators is the direct cause of this LFI.

Code Analysis

The vulnerability is evident in the pre-patch logic of install/upgrade.php. The code extracts the action parameter and splits it without verifying the content of the resulting segments.

Vulnerable Code (Pre-Patch):

// The 'action' input is split, and the first part is trusted implicitly.
$bits = explode("_", $mybb->input['action'], 2);
if(!empty($bits[1])) 
{
    $from = $bits[0]; // $from is tainted user input
    $runfunction = next_function($bits[0], $bits[1]);
}
 
// ... inside next_function($from, ...)
// The tainted variable is used to construct a file path.
load_module("upgrade".$from.".php"); 

Patched Code (Fix):

The fix, applied in version 1.8.39, introduces strict validation using ctype_alnum(). This function verifies that the input consists solely of alphanumeric characters, effectively rejecting any payload containing dots (.) or slashes (/), which are required for path traversal.

$bits = explode("_", $mybb->input['action'], 2);
if(!empty($bits[1])) 
{
    // Validation: Ensure the input is only alphanumeric
    if(ctype_alnum($bits[0]))
    {
        $from = $bits[0];
    }
    else
    {
        $from = 0; // Fallback to safe default on failure
    }
    $runfunction = next_function($from, $bits[1]);
}

Additionally, a defense-in-depth check was added inside next_function to enforce the same alphanumeric constraint immediately before the load_module call.

Exploitation

Exploiting this vulnerability requires the attacker to have network access to the install/upgrade.php script. In a secure MyBB installation, this directory is locked via a lock file. Therefore, the attacker must either be an authenticated administrator (who is allowed to run upgrades) or target a server where the install/ directory was left unlocked or the lock file was deleted.

Attack Vector:

The attacker constructs a GET or POST request to install/upgrade.php. The malicious payload is injected into the action parameter. Because the application appends .php to the include path, the attacker is limited to including files that end in .php or files that the server will execute as PHP regardless of extension (if configuration allows, though the code explicitly adds the extension).

Payload Example:

GET /install/upgrade.php?action=../../../../tmp/malicious_payload_next&step=... HTTP/1.1
Host: target-forum.com
Cookie: [Admin Session Cookies]

In this scenario, if the attacker has previously managed to upload a file named malicious_payload.php to /tmp/ (perhaps via a separate avatar upload vulnerability or session file poisoning), the application would execute load_module("upgrade../../../../tmp/malicious_payload.php"). This resolves to /tmp/malicious_payload.php, resulting in Remote Code Execution (RCE).

Impact Assessment

The impact of this vulnerability ranges from sensitive information disclosure to full Remote Code Execution (RCE), depending on the attacker's ability to introduce files onto the server's filesystem.

Confidentiality: While the LFI is restricted by the appended .php extension, an attacker might be able to execute sensitive PHP configuration files. However, since they are executed rather than printed, reading source code is difficult unless the attacker uses PHP wrappers (e.g., php://filter), which may be difficult given the string concatenation structure.

Integrity & Availability: The primary risk is RCE. If an attacker can upload a file (e.g., a disguised image containing PHP code) or manipulate session files, they can use this LFI to execute that code. This grants full control over the web application, allowing the attacker to modify the database, delete forums, redirect users, or pivot to the underlying server operating system. The CVSS score of 7.2 reflects this high impact, tempered only by the high privileges or specific race conditions (unlocked installer) required for exploitation.

Official Patches

MyBBMyBB 1.8.39 Release Notes
GitHubCommit fixing the LFI vulnerability

Fix Analysis (1)

Technical Appendix

CVSS Score
7.2/ 10
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
EPSS Probability
0.13%
Top 68% most exploited

Affected Systems

MyBB Forum Software

Affected Versions Detail

Product
Affected Versions
Fixed Version
MyBB
MyBB Group
< 1.8.391.8.39
AttributeDetail
CWE IDCWE-22
Attack VectorNetwork
CVSS v3.17.2 (High)
EPSS Score0.00128
ImpactRemote Code Execution (RCE) / LFI
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1059.006Command and Scripting Interpreter: Python/PHP
Execution
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Known Exploits & Detection

GitHub Security AdvisoryOfficial advisory containing vulnerability details and fix information.

Vulnerability Timeline

Vulnerability Disclosed (GHSA-q4jv-xwjx-37cp)
2025-06-02
MyBB 1.8.39 Released with Fix
2025-06-02
CVE-2025-48940 Published
2025-06-02

References & Sources

  • [1]GHSA-q4jv-xwjx-37cp: Local File Inclusion in Upgrade Module
  • [2]CWE-22: Improper Limitation of a Pathname to a Restricted Directory

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.