Live data from Hacker News

Subresource Integrity

githubengineering.com

21–30 of 78 posts

Re: Subresource Integrity

#21
Would love for the next generation of SRI to include signatures as an option (e.g. integrity="ed25519-").

Hashes means you have to specify an exact version, so there's not an easy way to add integrity to things like Google's CDN for jQuery that has latest minor version update links for the major API versions of jQuery.

Of course, that means also adding a signature to the payload response (maybe an "Integrity: -" header?). So it's understandable why signatures weren't in scope for the first release.

Re: Subresource Integrity

#22

This looks like a fantastic technology to protect against maliciously injected javascript. Great to see GitHub leading the charge here and taking their security seriously.

As mentioned in the article, they were victims of such an attack.

Frankly I'm relieved to see that browser vendors and leading tech firms are maintaining control of the situation and protecting users, even if driven by self-interest.

Re: Subresource Integrity

#23

Earlier quoted context omitted.

There's subtle, dangerous ways this can be exploited. (Short version: It'd make SRI usable as an oracle to confirm or deny guesses for the content of a cross-domain resource.)

How is that dangerous?

It leaks private user info -- a malicious server could include a JS file confirmed to be highly sensitive/top secret, and measure whether the client already has that cached. If so then the user is confirmed a sensitive target.

Re: Subresource Integrity

#24

Couldn't the great chinese firewall just intercept Github.com's HTML page as well and change the subresource integrity hashes? I thought that the Great Chinese Firewall already has the ability to penetrate SSL connections via some means.

Yes, though it involves actively processing every request for every page and processing it to replace (or just remove) integrity attributes from the HTML; that's a lot harder than just wholesale replacing the contents of specific JavaScript files on their way across the firewall.

Re: Subresource Integrity

#25
post #21

Would love for the next generation of SRI to include signatures as an option (e.g. integrity="ed25519- "). Hashes means you have to specify an exact version, so there's not an easy way to add integrity to things like Google's CDN for jQuery that has latest minor version update links for the major API versions of jQuery. Of course, that means also adding a signature to the payload response (maybe an "Integrity: - " he…

Signatures are taken care of by connecting via TLS.

If a hypothetical attack breaks TLS or you don't use it, you can just change the public key served.

Re: Subresource Integrity

#28
post #21

Would love for the next generation of SRI to include signatures as an option (e.g. integrity="ed25519- "). Hashes means you have to specify an exact version, so there's not an easy way to add integrity to things like Google's CDN for jQuery that has latest minor version update links for the major API versions of jQuery. Of course, that means also adding a signature to the payload response (maybe an "Integrity: - " he…

Signatures are taken care of by connecting via TLS. If a hypothetical attack breaks TLS or you don't use it, you can just change the public key served.

This is to prevent files on a 3rd party CDN from being loaded if they've been replaced with malicious ones.

Re: Subresource Integrity

#29

Couldn't the great chinese firewall just intercept Github.com's HTML page as well and change the subresource integrity hashes? I thought that the Great Chinese Firewall already has the ability to penetrate SSL connections via some means.

The Great Firewall would probably have copies of private keys issued by CNNIC, and there's a bunch of attacks to get private keys via heartbleed, and a bunch of Debian easily guessable private keys, but there's no general purpose 'penetrate SSL' attack that we know of right now.

Re: Subresource Integrity

#30
Edit : post below is right, nonces are only for inline scripts https://bugs.webkit.org/show_bug.cgi?id=89577

original: IIRC CSP already has hashes for resources, which also would handle this purpose.

As a side note, there's at least one CDN already hosting fake copy of bootstrap - I've seen a mlicious extension loading it in my report-uri.io logs.

Post reply on HN