News for hackers. Stuff that matters.
Re:Protecting sites from Cryptojacking with CSP and SRI by amenghra on Sunday February 11, 2018 @01:40PM (#16354025)
The right answer is to specify a HMAC when serving js from third parties.

CSP/SRI already enables this.

Ideally you should be able to serve content from your own domain + specify the hash, and let browsers optimize things by re-using cached content from another domain. There’s no easy/standardized way of doing that today.

Re:Protecting sites from Cryptojacking with CSP and SRI by greglindahl on Sunday February 11, 2018 @01:54PM (#16354114)
I think you can already do a browser extension that intercepts loads and gets things with script integrity from a cache, another domain, ipfs, whatever.

Decentraleyes is an example of an existing codebase you could use: https://github.com/Synzvato/decentraleyes

Re:Protecting sites from Cryptojacking with CSP and SRI by Scott_Helme_ on Sunday February 11, 2018 @02:11PM (#16354203)
There is/was discussion in the standards body of using the SRI hash for exactly this purpose. It sounds really promising but iirc there was a privacy kink to work out.
Re:Protecting sites from Cryptojacking with CSP and SRI by sago on Sunday February 11, 2018 @02:44PM (#16354350)
You could potentially tell whether someone has been to a third-party site.

Person goes to a porn site, get's file #A.

Spying site, offers file #A, but never delivers it.

If a person already has #A (i.e. doesn't request it), spy site knows they've been to porn site.

Re:Protecting sites from Cryptojacking with CSP and SRI by stordoff on Sunday February 11, 2018 @11:42PM (#16356588)
Could you limit it to widely used libraries? e.g. browser ships with the last N versions of jQuery etc., and avoids the request if it's a known hash. If it's widely used, it seems like the amount of information leaked would be low, and if the browser _always_ ships with it (rather than caching on first use), it would only identify the browser and not browsing history anyway.

As a bonus, developers could use it knowing that there is much less likely to be a performance hit from fetching it.