PT-2013-02: Password Reset Token Prediction in FluxBB

(PT-2013-02) Positive Technologies Security Advisory
Password Reset Token Prediction in FluxBB

Vulnerable software

Version: 1.5.2 and earlier

Application link:

Severity level

Severity level: High
Impact: Password Reset Token Prediction
Access Vector: Remote

CVSS v2:
Base Score: 9.3
Vector: (AV:N/AC:M/Au:N/C:C/I:C/A:C)

CVE: not assigned

Software description

FluxBB is a fast, light, user-friendly, free and open-source forum application for your website.

Vulnerability description

The specialists of Positive Technologies have detected a "Password Reset Token Prediction" vulnerability in FluxBB.

The vulnerability was detected in password reset token generation algorithm. FluxBB generates weak random numbers using mt_rand function:

function random_key($len, $readable = false, $hash = false)
/* ... */
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for ($i = 0; $i < $len; ++$i)
$key .= substr($chars, (mt_rand() % strlen($chars)), 1);

FluxBB also leaks mt_rand output in "search_id" parameter:
$search_id = mt_rand(1, 2147483647);

After requesting password reset FluxBB generates password reset token and the new password like this:

// Generate a new password and a new password activation code
$new_password = random_pass(8);
$new_password_key = random_pass(8);

In order to predict these values an attacker should send large number of keep-alive requests so that web-server starts to create new processes with freshly seeded Mersenne Twister. He then should make two requests in keep-alive:

GET /search.php?action=search&keywords=test&search=Search
POST /login.php?action=forget_2

The first request will return "search_id" parameter in redirection URL which leaks mt_rand number. Because in keep-alive PRNG state is shared, using this number we can bruteforce seed and thus predict password reset token and the new password that were generated after the second request.

How to fix

Update your software up to the latest version.

Advisory status

17.01.2013 - Vendor gets vulnerability details
22.02.2013 - Vendor releases fixed version and details
07.03.2013 - Public disclosure


The vulnerabilities has discovered by Arseniy Reutov, Positive Research Center (Positive Technologies Company)


Reports on the vulnerabilities previously discovered by Positive Research:

About Positive Technologies

Positive Technologies is among the key players in the IT security market in Russia.

The principal activities of the company include the development of integrated tools for information security monitoring (MaxPatrol); providing IT security consulting services and technical support; development of the Securitylab leading Russian information security portal.

Among the clients of Positive Technologies, there are more than 40 state enterprises, more than 50 banks and financial organizations, 20 telecommunication companies, more than 40 plant facilities, as well as IT, service and retail companies from Russia, the CIS countries, the Baltic States, China, Ecuador, Germany, Great Britain, Holland, Iran, Israel, Japan, Mexico, the Republic of South Africa, Thailand, Turkey, and the USA.

Positive Technologies is a team of highly skilled developers, advisers and experts with years of vast hands-on experience. The company specialists possess professional titles and certificates; they are the members of various international societies and are actively involved in the IT security field development.