PT-2013-02: Password Reset Token Prediction in FluxBB Vulnerable softwareFluxBB Version: 1.5.2 and earlierApplication link: http://fluxbb.org/Severity levelSeverity 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 descriptionFluxBB is a fast, light, user-friendly, free and open-source forum application for your website.Vulnerability descriptionThe 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 form_sent=1&req_email=admin%40email.comThe 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 fixUpdate 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 disclosureCreditsThe vulnerabilities has discovered by Arseniy Reutov, Positive Research Center (Positive Technologies Company)Referenceshttp://en.securitylab.ru/lab/PT-2013-02 Reports on the vulnerabilities previously discovered by Positive Research:http://ptsecurity.com/research/advisory/ http://en.securitylab.ru/lab/