A feature that's been missing for a long time

Oct 5, 2009 13:46 GMT  ·  By

Google has silently implemented cross-site request forgery protection for Gmail authentication. The new feature comes in the form of a unique token stored in a browser cookie and checked when the login request is submitted.

Cross-site request forgery (CSRF) attacks involve tricking a browser to perform a request that was not authorized by its owner and the targeted website to accept it. In this context, CSRF exploits the inherent trust that websites have put in their clients.

In order to track logged in users and not require that they input their credentials for every action they perform, a website stores a session cookie in their browsers. This cookie is cleared when its expiration time is reached or when the user hits the sign out button.

As long as this cookie is still active, users are at risk if they visit a maliciously crafted page that silently instructs their browser to access a link defining an action on the original website. The request will be performed because the user's session is still active.

In order to protect against such attacks, the websites can implement another layer of validation for all requests in the form of unique random tokens, which the attacker doesn't know. CSRF vulnerabilities were discovered in various Google services, including Gmail, before and even though all of them have been patched, the authentication page was left unprotected due to concerns that a token-based implementation might break the login experience for some users.

Back in September 2008, Jeremiah Grossman, a reputed Web application security researcher, demonstrated a proof-of-concept attack that compromised the privacy of registered YouTube users. It required tricking the victim into viewing a malicious SWF file hosted on *.google.com. The Gmail login CSRF weakness was exploited to silently authenticate the victim with the Gmail credentials provided by the attacker and access the file hosted in the associated account.

According to The Register, a Google spokesperson confirmed that CSRF protection was added to the login pages of Gmail and other services. "The security of our users' accounts is very important to us, and we're always looking for ways to make improvements," they noted.