Security specialists from RIPS Technologies have published information about the vulnerability they found in the phpBB3. The bug allows an attacker, having obtained the rights of the administrator of one of the forums, to execute his own code and to seize complete control over the entire server.
Forum administrators can edit the downloaded images and specify the absolute path to the system using the ImageMagic editor. To use the vulnerability, the hacker must upload to the server a file with his own code and know the exact path to it. When attacking, the Phar deserialization vulnerability is used, based on the use of
.phar PHP archives. It includes the following steps:
- Upload file. First, the attacker needs to upload a file with malicious code to the server. This can be done even with the rights of an ordinary user, since the forums allow uploading attachments to posts.
- Shift extension. The engine checks the file extension, and does not allow downloading data with extensions other than the ones allowed. However, for a PHP archive file, you can change the extension to .jpeg or any other from the white list, which will not prevent its launch.
- Extract the exact file path. However, another difficulty arises. All uploaded phpBB3 files are assigned random names, so the exact path to the code remains unknown to the hacker. Hacker can get around this by activating the download file in parts. The server receives the fragmented code and collects it in a temporary file, the name of which is generated from the name of the received file, its extension and a special parameter -
plupload_salt- unique for each server. The value of the
plupload_salthacker can obtaine from the server backup, administrator rights needed. In order for the engine not to delete the temporary file, hacker can declare sending more packages than actually, forcing the system to expect the missing ones.
The information is published on the company's website on November 20, 2018, a month and a half after the actual detection of the vulnerability. During this time, the developers of the engine managed to release a patch 3.2.4, eliminating the possibility of an attack. Thus, for servers that have the latest software version installed, the danger is eliminated.
At the same time, RIPS Technologies experts note that Phar deserialization is a new technique, and the problem may affect many similar systems.
RIPS Technologies regularly reports vulnerabilities found in various CMS. In early November 2018, the company's specialists found serious bugs in the WooCommerce plugin for WordPress.