I went to test something in the latest Chrome and noticed my site was broken - none of the CSS was loading.
Looking in developer tools there were a whole bunch of Mixed Content warnings citing the Onion address:
Mixed Content: The page at 'https://www.bentasker.co.uk/' was loaded over HTTPS, but requested an insecure prefetch resource 'http://6zdgh5a5e6zpchdz.onion/templates/joomspirit_76/css/compiled.css'. This request has been blocked; the content must be served over HTTPS.
I do run a split cache between the onion and www site, so I initially assumed that something had somehow jumped the cache and polluted the clearnet one, but a search of the markup showed no references to loading static content from 6zdgh5a5e6zpchdz.onion
Similarly, using Chrome's "Copy as CURL" against the same box didn't yield any matches
ben@milleniumfalcon:~$ curl 'https://www.bentasker.co.uk/' -H 'authority: www.bentasker.co.uk' -H 'pragma: no-cache' -H 'cache-control: no-cache' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Mobile Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' -H 'sec-fetch-site: none' -H 'sec-fetch-mode: navigate' -H 'sec-fetch-user: ?1' -H 'sec-fetch-dest: document' -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' -H 'cookie: 6849605f66eba1c621d70b2e8a636c78=655dqc21h89eutjg9crh525vk2' --compressed -s -H "Host: www.bentasker.co.uk" -6 -g https://[2001:41d0:2:a192::2]/| grep 6zdgh
var h = window.location.hostname;if (h.endsWith('.onion') && !h.endsWith('5e6zpchdz.onion') && !h.startsWith('6zdgh5') ){window.location.href = atob('aHR0cDovLzZ6ZGdoNWE1ZTZ6cGNoZHoub25pb24v') + window.location.pathname + window.location.search;}
Activity
2020-06-20 10:23:10
2020-06-20 10:25:09
This header should be ignored by all but Tor Browser Bundle.
So, I went and commented out the relevant line in Nginx on the box I was hitting
Chrome suddenly, magically, works.
I wonder if they've got some kind of glob for "Location" in the codebase somewhere?
The odd thing is, in the
2020-06-20 10:26:06
2020-06-20 10:30:08
View Commit | View Changes
2020-06-20 11:01:12
I just added a made up header
And Chrome broke again.
Actually.... no. The mixed content warnings still refer to
This time I do see the onion names in the response
2020-06-20 11:16:24
Back when I set up the multi-homing of the site, I set up a variable to be included in the cache key to identify whether the asset was for the Onion version of the site or not - https://projects.bentasker.co.uk/jira_projects/browse/MISC-2.html#comment657857
Some time back, the proxy settings were broken out into a separate file (under BEN-608) and this differentiator was inadvertently lost. This probably happened because it was only applied to certain locations - dynamic pages.
Which doesn't answer why my earlier tests didn't yield the same results - I guess the answer is to search the cache files (I guess the most likely candidate would be
2020-06-20 11:20:08
View Commit | View Changes
2020-06-20 11:22:24
That's significantly more hits than expected
OK, so if we compare two files, we can see that
2020-06-20 11:26:37
If we copy as curl again
Notice it uses
Also, it writes in the URL rather than using
So,
Whereas looking in Developer tools, Chrome sends
2020-06-20 11:36:29
At some point, someone has viewed my Onion -
Because it was an onion request, the URL of static resources was rewritten from
Because the onion differentiator variable was missing, that response was cached and returned to any user who's browser also sends
My habit of trying to confirm things with
Testing a random hypothesis (have Chrome fucked up a regex?) and actually looking at the results set me back onto the right path
Marking this as Fixed
2020-06-20 11:38:32
2020-06-20 11:39:46
2020-06-20 11:39:46
2020-06-20 11:39:49