########################################################################################## MISC-40: Chrome trying to load static content from my Onion breaks rendering ########################################################################################## Issue Type: Bug ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Fixed (2020-06-20 11:39:46) Project: Miscellaneous (MISC) Reported By: btasker Assigned To: btasker Labels: Bentasker.co.uk, Onion, Tor, Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== 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: -- BEGIN QUOTE -- 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. -- END QUOTE -- 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 -- BEGIN SNIPPET -- 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;} -- END SNIPPET -- ----------------------------------------------------------------------------------------- Attachments ============ - Screenshot_20200620_100119.png ----------------------------------------------------------------------------------------- Issue Relations ================ - Caused by BEN-608: Nginx Filtering Rules - Chromium Bug 1097465 (https://bugs.chromium.org/p/chromium/issues/detail?id=1097465) - Initial Twitter Thread (https://twitter.com/bentasker/status/1274268117351497733) ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2020-06-20 10:23:10 ----------------------------------------------------------------------------------------- btasker added 'Screenshot_20200620_100119.png' to Attachments ----------------------------------------------------------------------------------------- 2020-06-20 10:25:09 btasker ----------------------------------------------------------------------------------------- I did recently make a change though, to add an Onion-Location header to responses - https://www.bentasker.co.uk/blog/privacy/693-onion-location-added-to-site 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 -- BEGIN SNIPPET -- # add_header Onion-Location http://6zdgh5a5e6zpchdz.onion$request_uri; -- END SNIPPET -- 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 Network tab of developer tools, it doesn't show as a redirect - you get the request for the root document, and then a bunch of failed (blocked) requests because of the mixed content thing. ----------------------------------------------------------------------------------------- 2020-06-20 10:26:06 btasker ----------------------------------------------------------------------------------------- I searched the Chromium bugtracker and couldn't find anything, so I've raised https://bugs.chromium.org/p/chromium/issues/detail?id=1097465 for this. ----------------------------------------------------------------------------------------- 2020-06-20 10:30:08 git ----------------------------------------------------------------------------------------- -- BEGIN SNIPPET -- ------------------------- From: git@