I assure you no average person cares or knows about https mixed content warnings, which are very subtle. Whereas the page bouncing around like an earthquake just hit is irritating and plainly visible to all users.
Well, we need to download the images to get the proper sizes, so this is part of the problem
Not really, in the case of github the avatars are all fixed size anyway. Just specify a fixed size in the onebox.
That is now done
for this features, based on my related question Don't load http onebox images when using https
That is not wise. At all.
Part of the SSL ‘industry’ includes educating consumers about the look of the padlock. Some corporations and business entities will go the extra length to get the certificate that includes their name.
Google is also using HTTPS as a deciding factor for page ranking.
That Google actually checks fully for SSL errors now is irrelevant. What is relevant is someday they may do just that and more to make sure SSL certs are not purchased just for pagerank. They are already checking for mixed context in some form.
With all of these factors, you are only setting yourself up for a massive headache when Discourse-backed sites are penalized because of OneBox use.
You cannot bank on every single person that connects to a Discourse instance to not notice the broken padlock. I have noticed it. I know it also relates to OneBoxed youtube videos because I tested here on Meta.
A broken padlock = zero integrity. For an online business that means everything. Especially if they purchased the SSL just to have the padlock in the first place.
I implore you to reconsider. If not for everyone else then at least to mitigate. One ounce of prevention is worth a pound of cure.
e.g. when I go from “page” to “page” here there is an incorrect yellow padlock mixed content warning on this page which is not correct. It reflects previous page state. If you hard refresh this “page”, it shows green padlock.
Even then that still does not change the fact we all have the ability to use our peripheral vision to notice the padlock is broken.
EDIT: Also, just because pageviews are generated for a user on the fly does not mean the static html will not have an error. Bots read html and that html will have the mixed content as well.
I did a security run to fact check your reply.
If this site detected it despite the dynamic per-user nature of the front end, then google will too.
Again, these errors will possibly penalize a site in some way. If not now, the future is uncertain.
My initial statement still stands.
I guess the solution here is to check if the Discourse forum is http or https and if not https don’t allow oneboxing http content. (with a “sorry” message would be best)
If local-caching is not available right now for this, I think you’re right. Or perhaps disable all media and allow text-only.
As for an admin-user who has SSL but insists on disabling local caching for all images (OneBox or otherwise), that is out of purview.
I just noticed an easy solution for part of this. Imgur supports https, and it’s big enough that rewriting all i.imgur.com links to be https is probably worth the effort.
Yes, agreed. That is in relation to the idea of supporting any other OneBox sites that have https available. I know there’s also a few places that list all official https-carrying sites so browsers know to auto-ask for https first. Hooking into that may help if a user links media from a https site yet accidentally used http by mistake for whatever reason.
I love the idea of rewriting known URLs to https… but it seems to me that importing all the myriad of images, scripts, etc, which might be referenced in a onebox’d URL is a lot of stuff being imported.
Would it be reasonable/doable to add a knob that disables oneboxing in all cases except where it can be guaranteed to not cause a mixed-content warning?
The mixed content warnings were bugging me, so I looked at the code in order to fix this. Unfortunately there’s more than one reason why images within oneboxes aren’t downloaded.
I’ll at least try to document my findings:
As @zogstrip mentioned images inside oneboxes should be ignored. But they aren’t since the
doc.css(".onebox-result img")doesn’t do anything. Is the
onebox-resultclass still used? I saw only
onebox-bodywhen I included Github and whitelisted oneboxes.
Discourse downloads all the images embedded in oneboxes, but many of the embedded images have no recognizable file extension.:
- Gravatar used at Stackoverflow:
- Avatar used at Github:
- Discourse looks only at the file extension and since it doesn’t find a known image extension, it stores it as simple upload, not as image.
- If we are lucky and the image embedded in the onebox has a valid image file extension, we run into the last problem. Image URLs are only replaced within the post’s
rawtext, but the onebox images aren’t there. They are stored in
Links to Amazon cause a TLS mixed content warning
I have a similar problem in this post. It links to
which unfortunately redirects to the http:// version (they’re sorry for destroying the padlock on this Meta page…). The image is, though, available via https:
Would it be possible for the Onebox code to check if the image is also available via HTTPS, and if so, change the URL to HTTPS? No local downloading necessary.
Another possible solution would be to add a feature to GitHub - discourse/onebox: A gem for turning URLs into website previews to have a second whitelist like onebox/whitelisted_generic_onebox.rb at 34cd201b72b3c6fc8058267796424f245bda0f45 · discourse/onebox · GitHub that supports only sites that have HTTPS properly configured.
Would a PR for that feature be welcome?
I notice that this still hasn’t been addressed (at least as of v1.7.0.beta7 +27).
Are there still any plans for local-caching assets that may be called by a onebox?
Right now the behavior is fine while browsing the topics until you stumble across a post that has mixed-content due to a onebox. The bigger problem is that once you’ve hit that post all subsequent browsing in that session will cease to show the green padlock.
That’s interesting that the tab maintains the mixed content warning!
I think there are actually plans to make this worse, because
New in Discourse 1.7 beta! All links will now be oneboxed and prettified, if you paste them on a line by themselves:
I asked if there were any plans to fix it:
any corresponding improvements to the mixed content SSL warnings caused by oneboxing?
and the response was
unfortunately we do not control all websites on the Internet
We should proxy all one box content locally where possible, I totally support a PR to improve this. Further more I support a PR for a site setting that disables unsafe embeds (it should be default on)