Security Issue In Google Website Optimiser
We received an email from Google today regarding a security issue in Google Website Optimizer, see below:
“Dear Website Optimiser user,
We are writing to inform you of a potential security issue with Website Optimiser. By exploiting a vulnerability in the Website Optimiser Control Script, an attacker might be able to execute malicious code on your site using a Cross-Site Scripting (XSS) attack. This attack can only take place if a website or browser has already been compromised by a separate attack. While the immediate probability of this attack is low, we urge you to take action to protect your site.”
The letter goes on to say that they have fixed the bug and that no new experiments are susceptible, but any old experiments that were created before 3rd December 2010 are.
I wonder how many people’s experiments will be destroyed if they stop them before they are conclusive – some experiments could feasibly go on for months to get enough data to provide an accurate picture.
This is slightly worrying, how long has this cross-site scripting vulnerability been present? How many websites are likely to have been affected by this?
Is it a good idea announcing this if people are running experiments that they NEED to keep running?
Creating a New Experiment
- Stop any currently running Website Optimiser experiments
- Remove all the Website Optimiser scripts from your site
- Create a new experiment as normal. New experiments are not vulnerable.
Updating the Website Optimizer Control Script Directly
- Locate the Control Script on your site. It looks like this:
A/B Test Control Script
<!-- Google Website Optimiser Control Script -->
<script>
function utmx_section(){}function utmx(){}
(function(){var k='XXXXXXXXXX',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return c.substring(i+n.
length+1,j<0?c.length:j)}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" charset="utf-8"></sc'+'ript>')})();
</script><script>utmx("url",'A/B');</script>
<!-- End of Google Website Optimizer Control Script -->Multivariate Test Control Script
<!-- Google Website Optimizer Control Script -->
<script>
function utmx_section(){}function utmx(){}
(function(){var k='XXXXXXXXXX',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return c.substring(i+n.
length+1,j<0?c.length:j)}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" charset="utf-8"></sc'+'ript>')})();
</script>
<-- End of Google Website Optimizer Control Script -->- Locate the following in the Control Script:
return c.substring(...- Modify the following line as shown:
BEFORE:return c.substring(i+n.length+1,j<0?c.length:j)
FIXED:returnescape(c.substring(i+n.length+1,j<0?c.length:j))
Make sure to include the final closing brackets “)”Fixed A/B Control Script
<!-- Google Website Optimizer Control Script -->
<script>
function utmx_section(){}function utmx(){} (function(){var k='XXXXXXXXXX',d=document,l=d.location,c=d.cookie;function f(n){ if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);
return escape(c.substring(i+n.length+1,j<0?c.length:j))}}}
var x=f('__utmx'),xx=f('__utmxx'),h=l.hash; d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" charset="utf-8"></sc'+'ript>')})();
</script><script>utmx("url",'A/B');
</script>
<-- End of Google Website Optimizer Control Script -->Fixed Multivariate Control Script
<!-- Google Website Optimizer Control Script -->
<script>
function utmx_section(){}function utmx(){}
(function(){var k='XXXXXXXXXX',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);
return escape(c.substring(i+n.length+1,j<0?c.length:j))}}}
var x=f('__utmx'),xx=f('__utmxx'),h=l.hash; d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" charset="utf-8"></sc'+'ript>')})();
</script>
<-- End of Google Website Optimizer Control Script -->Note that the
k=XXXXXXXXXline in the above Control Script examples is a placeholder.Your experiment will continue as normal after you’ve made this update. There’s no need to pause or restart the experiment.
We’re committed to keeping Website Optimiser secure, and we’re deeply sorry for this issue. We will continue to work hard to prevent future vulnerabilities.






Paul 926 days ago
Could this be a hoax?
David Whitehouse 926 days ago
I don’t think so, it wouldn’t be a very good hoax, as it doesn’t trick you into doing anything.
Andy Havens 926 days ago
http://havenscommunications.comHi David,
Either I never got the note or I didn’t look in the right place. Thanks for the heads up.
As far as stopping critical experiments are concerned, I’d say this needs to be decided on a case by case basis.
Of course, it might help to know WHAT someone could do if they got in and what kind of code they could inject and where. Sure there’s a trade off involved, the more big G reveals the more potential for exploitation but if you know what to expect you can prepare or at least make an informed decision. I prefer the latter.
Another consideration is how long the exposure will be. If the experiment is near the end, then it might be worth the risk. This is one reason I like to keep experiments relatively small. Don’t forget how England trashed the Spanish Armada with smaller, faster ships.
Once the risk is compared to the reward, the decision should be easier.
Trevor Claiborne 926 days ago
http://www.google.com/websiteoptimizerJust wanted to say, if you update the Control Script according to the email you do not need to stop the experiment. You can do that while the experiment is running.
Matthew 925 days ago
Dave,
Your readers may be interested in a cool little code checker at http://www.observepoint.com/optimizer-test.php
You enter the URL of the page in question, and it will tell you whether the google website optimizer code is up-to-date, and if it needs to be edited, it will tell you what to change and where to change it.
Ray 923 days ago
http://www.seo.co.ukThat’s interesting stuff but you have to give them (Google) credit for contacting those affected.
Jeorge Peter 919 days ago
http://www.wickedinnovations.com/Don’t know but that gives me problems, I want to learn it if only that can be easy.
Drew Williams 919 days ago
http://www.bluemonkeyweb.co.ukThanks for this – I never got the note either, looks like google arent telling everybody!!
Jeorge Peter 917 days ago
http://www.wickedinnovations.com/I want to learn that, a way to get secured more out of your google account is essential for your safety online.