Skip to content
Disclosed report CVE-2010-4568

[SECURITY] Tokens generated from weak source of randomness, allowing an attacker to guess a password change token and change the password of any account

willem Follow

Originally disclosed on Mozilla

  • Fixed in 40 days
  • Paid in 2.9 years
  • Disclosed after 40 days
Text
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101212 Gentoo Firefox/3.6.13
Build Identifier: Bugzilla-3.6.3, as well as the version running on bugzilla.mozilla.org

To Whom It May Concern,

the Bugzilla 3.6.3, the bugzilla.mozilla.org website, and likely other versions and instances of Bugzilla contain a critical vulnerability that can be used to recover a password reset token for any account. An attacker with an account on the bugzilla system can request a password reset for any other account and through efficient bruteforce recover the token, the attacker can use the token to changethe password of the victim's account and login as the victim.

A Quick explanation.

Bugzilla uses rand and srand in perl, which are based on srand48 and drand48 on Linux (and possibly other OS's) srand48 is seeded with at most 32 bit of entropy. Using a modern machine one can go through these 32bits in a very short amount of time, less than 10 minutes on my machine.

Bugzilla uses (s)rand to generate their tokens and to generate their login cookie. When accessing token.cgi with the attackers login credentials Bugzilla will login the attacker and send him a login cookie made using generate_random_password, the attacker can recover the seed used for srand from this, and use it to know the full internal state of the random number generator.

The same request is used by the attacker to request a password reset for the account the attackers wants to take over. For the reset procedure a token will be generated and send to the victim, if the attacker can find this token he can reset the victims password. Since the token is also created using generate_random_password and uses the internal random state that was left after making the login cookie the attacker can easily deduce the token send to the victim.


Steps for a succesful attack:

request a password reset for the victim account, while logging into to Bugzilla:

POST /token.cgi
---
Bugzilla_login=<ATTACKER_LOGIN>&Bugzilla_password=<ATTACKER_PASSWORD>&Bugzilla_remember=on&loginname=<VICTIMLOGINNAME>&a=reqpw



the response from the server will contain:

Set-Cookie: Bugzilla_logincookie=LPfN86mTdY; path=/; expires=Fri, 01-Jan-2038 00:00:00 GMT; secure; HttpOnly

while the victim will be sent an email with a token in it.


Next the attacker finds the random state used to generate his login Cookie and calculates the next token that BugZilla generated:

./randfindclean LPfN86mTdY
found at seed: -43631713 // fd663b9f
YKWG0y4oQT

(randfindclean finds the seed used to make the logincookie, and then calculates the token based on rand state)

and uses the token to login as the victim and change their password.

---- copy paste from the victims email ---
You have (or someone impersonating you has) requested to change your
Bugzilla password. To complete the change, visit the following link:

https://bugzilla.mozilla.org/token.cgi?t=YKWG0y4oQT&a=cfmpw
-----

If there are any questions, please don't hesitate to contact me,
   Willem Pinckaers.



Reproducible: Always

Steps to Reproduce:
1.login while requestion a password change for the victim
2.based on logincookie, calculate the password token
3.change the victim password and login as the victim
Actual Results:  
Got access to the victim's account

Expected Results:  
r

The original report as published on Mozilla's Bugzilla, by willem. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A security bug in User Accounts. Mozilla made it public on 24 January 2011 as CVE-2010-4568.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.