4 ms·
I keep proposing "<a href="..." hash="sha256:abcdefg..."> as the quick, easy 80% solution to this. Works across sites and lets you authenticate resources you do
by pjc50 11y ago
I keep proposing "<a href="..." hash="sha256:abcdefg..."> as the quick, easy 80% solution to this. Works across sites and lets you authenticate resources you don't own.
- ldjb 11y agoThis is the first I've heard of this. Is this currently in the HTML specification or in actual use, or are you proposing such functionality be added to the spec?
- theandrewbailey 11y agoIt's called Subresource Integrity. I just implemented it on my blog yesterday. It only works on CSS and JS, but image support is supposedly coming. I highly doubt that it would be a good idea for hyperlinks. https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
- majewsky 11y agoI would argue it's a bad idea for images already. Images give away a lot about the type of content that you're viewing, which is possibly sensitive information. Consider, for example, a Chinese computer connecting to Wikipedia over HTTPS, which then downloads an image over HTTP without S that is clearly related to the Tiananmen massacre.
- theandrewbailey 11y agoI'm not saying that it's a replacement for HTTPS. Nothing stops you from using SRI hashes for HTTPS content. If you're concerned over censorship, you should be using HTTPS, period. SRI is more concerned about bad CDN content. Your CDN can use HTTPS, but your server's page says what the hash should be, so if your CDN goes rouge, things will start breaking.
- geofft 11y agoWorth noting: subresource integrity doesn't currently change the mixed-content algorithm at all. An HTTPS site can't load an HTTP + SRI script. It's useful for increasing the status quo on HTTP pages, or for defense-in-depth on HTTPS pages, but it doesn't actually enable you to do anything you couldn't before.
- geofft 11y agoThe hard part is delivering the initial page with those hashes. If you can deliver it over HTTPS, why can't you deliver everything over HTTPS? (There are good answers to that question, to be fair.) And if you can't, what use are the hashes?
- minitech 11y ago> If you can deliver it over HTTPS, why can't you deliver everything over HTTPS? > Works across sites and lets you authenticate resources you don't own.