HackDig : Dig high-quality web security articles

XSRF and Cookie manipulation on google.com

2014-08-08 23:53

Here I present a (reported and fixed) XSRF and Cookie manipulation vulnerability I discovered in google.com, which required no user interaction. It was possible to set arbitrary cookies and tamper with existing ones.

The bug

The bug is a lack of sanitization of the prefsval parameter, which is used in the response within a Set-Cookie header.


<PAYLOAD> allows commas and semicolons, thus allowing injection and cookie manipulation for browsers that allow Set-Cookie folding.

A proof-of-concept payload could be:


this sets the first cookie (called SC) to X, terminates it, sets a cookie named USER_CONTROLLED_COOKIE_NAME with content <script>alert('XSS')</script> (totally unescaped), terminates it, and sets another cookie DUMMY with the rest of the original, legitimate SC cookie.

It is also possible to set arbitrary expiration date and path, thus making it valid for google.com/ and not only google.com/finance. No anti-XSRF token was used.

Steps to reproduce:

  1. Let the victim, logged in her Google account, visit this crafted HTML page:
<body onload="document.forms[0].submit()">
<form action="http://www.google.ca/finance/prefs?action=set&prefsgroup=global
%20Max-Age=999999999;%20domain=.google.ca;,DUMMY=" method="post">
<input type="submit" value="Submit">
  1. She now has an arbitrary cookie set for google.com (USER_CONTROLLED_COOKIE_NAME), and a Google one (PREF) modified.


The vulnerability in Burp Suite

The vulnerability in Burp Suite

Cookie manipulation succeeded

Cookie manipulation succeeded

This vulnerability was fixed in a week. The request now requires an anti-XSRF token and returns HTTP 400/Bad Request if it is missing.

I received a $3133.7 reward and have been listed in the Google Security Hall of Fame for the fourth time.

Thank you, Google Security Team! :)

Source: elgoog-gnittes-eikooc-frsx/51/9/3102/golb/ti.ikim

Read:13244 | Comments:0 | Tags:No Tag

“XSRF and Cookie manipulation on google.com”0 Comments

Submit A Comment



Blog :

Verification Code:


Share high-quality web security related articles with you:)
Tell me why you support me <3

Tag Cloud