Moodle uses predictable password-recovery tokens
Impact
lib/moodlelib.php in Moodle through 2.6.11, 2.7.x before 2.7.10, 2.8.x before 2.8.8, and 2.9.x before 2.9.2 relies on the PHP mt_rand function to implement the random_string and complex_random_string functions, which makes it easier for remote attackers to predict password-recovery tokens via a brute-force approach.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| Earlier releases before 2.7.10Ecosystem versions | 2.7.10 |
| From 2.8.0 before 2.8.8Ecosystem versions | 2.8.8 |
| From 2.9.0 before 2.9.2Ecosystem versions | 2.9.2 |
Version evidence: OSV · GHSA-382v-gxj9-ffhc
View original version evidence (70 explicit versions)
Original source description
lib/moodlelib.php in Moodle through 2.6.11, 2.7.x before 2.7.10, 2.8.x before 2.8.8, and 2.9.x before 2.9.2 relies on the PHP mt_rand function to implement the random_string and complex_random_string functions, which makes it easier for remote attackers to predict password-recovery tokens via a brute-force approach.
References
- Security advisory nvd.nist.gov/vuln/detail/CVE-2015-5267
- Patch github.com/moodle/moodle/commit/289bc7f9e3022918b4cfd2cc9851472f0cea2896
- Patch github.com/moodle/moodle/commit/5337b2295237958c93b6c65fa595859aaa7bf257
- Patch github.com/moodle/moodle/commit/6e8224365ffcdf328458ea7852dc62574e806119
- Patch github.com/moodle/moodle/commit/e4ac3879c2d1f8fe66caa74ff1544248bccef61e
- Source reference github.com/moodle/moodle
- Source reference moodle.org/mod/forum/discuss.php
- Security advisory web.archive.org/web/20160323063809/http://www.securitytracker.com/id/1033619
- Source reference git.moodle.org/gw
- Security advisory www.openwall.com/lists/oss-security/2015/09/21/1