CSRF vulnerability found in Gmail; Google not willing to fix it
seclists.org
seclists.org
Step 2a. Ask them to create a username/password for their free Porn
Step 2b. Use the password to change their Gmail account login, download all their other account information and lock them out.
Step 3. Steal all the money from their bank account using the information from their Gmail account
Alternatively:
Step 1. As above
Step 2a. Show the user lots of free porn, etc to keep them on your site.
Step 2b. Do a scripted dictionary attack against the user's account to change their password using their cookies.
Step 3. As above
The essential point here is that using a non-cookie session based url identifier for things that change the state of a user's account is a must. At Yahoo! we call it a "crumb". Essentially print a unique (at least to the user) and verifiable key on your pages. Check for that key before accepting any requests to change stuff.
E.g:
Linking document
<?php
//This should really be a chunk from /dev/random $secret = 'unicorns'; $time = time();
setcookie("timestamp", $time);
$crumb = sha1($secret . $time);
?> <a href="doAmazingStuff.php?crumb=<?=$crumb?>">Do Amazing Stuff</a>
Action Document
<?php
$secret = 'unicorns';
if (isset($_GET['crumb'])) { $crumb_val = sha1($secret . $_COOKIE['timestamp']); if ($_GET['crumb'] == $crumb_val) { amazingStuff(); } else { showError('Crumb is invalid'); } } else { showError('No crumb to validate'); }
you replace the password query params with:
&group1=IdentityAnswer&IdentityAnswer=ANSWER_GUESS
not as improbable to guess since Google do not enforce a standard on the secret question answer (ie. with 'place you were born' you could just list major cities and probably get a hit every so often)
if you had access to a high traffic site (thank-you wordpress hax) you would probably harvest a number of accounts using this in an IFRAME pretty quickly. you just need to add some javascript to somehow inform you which ones were a success.
If you sent out spam containing a CSRF link that tried a dozen or so of the most common passwords, you might get a few hits, though I don't know why anyone would bother. Still, if I were Google, I would just fix it.
I'm a bit surprised that Google doesn't have a generic authenticity system for all of their forms, or if they do, why it would be omitted from this one form.
I'm now feeling like I need some sort of backup or other protective measure.
I suspect red flags will come up at google after first couple million requests. Or the victim will leave the hostile page he was lured to.
It would be wise if google forced the user to enter the capcha on password change.
Disallowing GET would be good as well. Otherwise attackers would would have to use POST, which would mean tricking the user to submit a html form, and I'm unsure if you can send multiple POST requests per submit.