You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2017. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 15, 2017. It is now read-only.
Front page on www.tsn.ca goes blank when user agent spoofing is enabled #261
Last night i discovered a problem with the following website: -www.tsn.ca It does not like the httpsb extension. The webpage initially loads the graphics but then goes all white! The only fix I could find was if I disable httpsb extension; disabling Matrix filtering won't even fix it [...] It looks like I found the problem; when I clear the checkbox for "Spoof User-Agent string by randomly picking a new one below every 15 minutes" the website will load normally
My findings:
In order to fix issue #252, I had to create a fake window.navigator object. But this was really tedious, as it appeared that my fake navigator object was trashed by the browser at some point when the page was loading. To prevent this, I freeze the fake navigator object, which means that nobody can change it. tsn.catries to add a property to the object, which fails, and which results in the failure of the whole page
Looks like freezing the fake window.navigator is not necessary. I had to create many prototypes until I got it right, so apparently I came to think freezing the object was needed while it is not.
It doesn't seem to have anything to do with HTTTPSB
I don't know, when I disable UA spoofing, the page doesn't go blank, so clearly somewhere in there, HTTPSB spoofing cause the page to fail, and it could be that one of the property in navigator.useragent is not properly emulated.
It's nice though that you found a workaround, I will pass it on to the user at Wilder Security.
Code above doesn't work with many of the listed UA here. Ok I will use the /, and ultimately it is up to the user to enter UA strings which are common (that's the point of spoofing), and apparently the common ones always include the / separator as you pointed out.
What if you do a parseFloat() first and then if its NaN you look for /? And if it is a float return the whole string? That would work on the example you post earlier. 1.0 (VMS; en-US) Mellblomenator/9000.
Nah, / is fine in the end given the purpose of UA spoofing in HTTPSB. The example at whatwg.org is for the value of appVersion, not the whole UA string. I think they just want to show that it can be more than just a version number, it can a version number and then a whole lot of other stuff following.
Activity
gorhill commentedon May 10, 2014
Looks like freezing the fake
window.navigatoris not necessary. I had to create many prototypes until I got it right, so apparently I came to think freezing the object was needed while it is not.gorhill commentedon May 19, 2014
It will take time to investigate, it's failing somewhere else and I have to find where in this maze of javascript.
my-password-is-password commentedon May 19, 2014
Try adding
||www.tsn.ca/scripts/min/hub/foot/139748129.jsto blocked rules in Ubiquitous rules.Its some tracking stuff that calls
trackPage()in the filehttp://www.tsn.ca/scripts/min/hub/head/139748129.jss_code is the tracking image when the page goes blank. Inspect the page and you can see its the same html code from that function.
I'm not sure if blocking that .js file breaks the rest of the page though.
gorhill commentedon May 19, 2014
I don't know, when I disable UA spoofing, the page doesn't go blank, so clearly somewhere in there, HTTPSB spoofing cause the page to fail, and it could be that one of the property in
navigator.useragentis not properly emulated.It's nice though that you found a workaround, I will pass it on to the user at Wilder Security.
my-password-is-password commentedon May 19, 2014
Theres a difference in
appVersion, the ua spoof starts off with "Mozilla/5.0 ..." while when spoof is off the appVersion starts with just "5.0 ...".Heres some code from one of the js file from the site that causes the problem. It does parseFloat() on the appVersion.
then there's a check later on using
s.apv,When its true ( spoof off ) it returns '' for s_code ,in the code from my last post, and doesn't do the document.write.
When its false ( spoof on ) it returns the
tag for s_code and it does the document.write.
Should it be something like
spoofedNavigator.appVersion = spoofedUserAgent.substr(spoofedUserAgent.indexOf('/')+1);incontentscript-uaspoof.js?gorhill commentedon May 19, 2014
Wow thanks for the help, this really saves me a lot of time. Now I have to look for the best fix, which apparently is to just find the first string segment which starts with a digit, as per http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-navigator-appversion
gorhill commentedon May 19, 2014
Code above doesn't work with many of the listed UA here. Ok I will use the
/, and ultimately it is up to the user to enter UA strings which are common (that's the point of spoofing), and apparently the common ones always include the/separator as you pointed out.my-password-is-password commentedon May 19, 2014
What if you do a parseFloat() first and then if its NaN you look for
/? And if it is a float return the whole string? That would work on the example you post earlier.1.0 (VMS; en-US) Mellblomenator/9000.Right?
gorhill commentedon May 19, 2014
Nah,
/is fine in the end given the purpose of UA spoofing in HTTPSB. The example at whatwg.org is for the value ofappVersion, not the whole UA string. I think they just want to show that it can be more than just a version number, it can a version number and then a whole lot of other stuff following.