jQuery.com Malware Attack Puts Privileged Enterprise IT Accounts at Risk
riskiq.com
riskiq.com
But there's an easy way to fix it. Browsers should support a hash attribute for <script> tags, so instead of
<script src="https://code.jquery.com/jquery-2.1.1.min.js">
sites could instead say <script src="https://code.jquery.com/jquery-2.1.1.min.js" hash="sha256:874706b2b1311a0719b5267f7d1cf803057e367e94ae1ff7bf78c5450d30f5d4">
This would also significantly reduce the risks from use of http instead of https, and from weaknesses in https itself.Example: User has jquery cached from googles CDN, jquery will not be loaded from microsofts cdn because it has the same hash.
http://www.chromestatus.com/features/6183089948590080 http://status.modern.ie/subresourceintegrity
> 3.2.1 Agility: the user agent will choose the strongest hash function in the list
Aside from the fact this contradicts the next section (Priority), it also would discourage browser vendors from adding better (slower) hashing functions as then they would be "forced" to utilise them.
Instead the standard should be: The "the fastest hash function which the browser finds secure." So if SHA-256 and SHA-512 were available, it would use SHA-256 until it was found insecure, then the browser would use SHA-512.
> Validation using unsupported hash functions always fails (see the “Does resource match metadataList” algorithm below). Authors are therefore encouraged to use strong hash functions, and to begin migrating to stronger hash functions as they become available.
No. Just no. If Chrome was the first to market with e.g. SHA-9999, I'd be unable to utilise that until literally every single browser on the market supported it (as it was fail by default).
Imagine if this standard existed in the IE6 days, today if you tried to use SHA-512 (which, let's assume, IE6 didn't support) the resources would fail to load every time (and you'd wind up having half a dozen different hashes just to hit something that was supported).
It should just ignore unknown hash functions, not fail. If the integrity attribute only had one hash function and it was unsupported then the entire attribute should be discarded.
Fail by default isn't even the HTML way. Ignore by default is.
Your proposal would make the hash attribute advisory. If I put a hash attribute on there, should I be able to count on it, and know that browsers won't load unless they can verify it? Or is it just advisory, and browsers may choose to ignore it, and I can't actually count on browsers only loading if hash matches?
Of course, I guess the fact that older browsers will always exist that ignore it (and that all browsers are essentially untrusted software, as far as the developer is concerned) may point to "you'd best consider it advisory only" anyway, I suppose.
https://codereview.chromium.org/566083003/
The tests show how simple the code is:
https://codereview.chromium.org/566083003/patch/120001/13000...
Just don't trust so many third parties with your site's security: Host jQuery (and other things) yourself.
Even if we ignore the hash suggestion, you don't want to have some dev on the other side of the planet suddenly update one of your libraries on your live website.
That should never be a thing in the first place, so it won't be a problem.
No, they will release a new version with a new URL.
But I don't think it will ever get much traction. Believe it or not, it's too far beyond the organizational and technical capacities of the people behind too many sites. The benefit, aside from slightly improved caching, will be minimal.
And if you're careful and meticulous you aren't doing braindead things like hotlinking javascript in the first place.
We are responsible for quite a lot of copy and paste script includes these days and could potentially push people in this direction.
If anyone is serious about investigating hash'ed includes shoot me an email with your thoughts, my email can be found on my HN profile.
It's an interesting problem nevertheless, and could be extended to any link or src attributes in tags.
In case the hash and the file dont match,the browser wouldnt load that file.
Exploits:
Java – CVE-2012-0507, CVE-2013-2465
IE 7/8/9 – CVE-2013-2551
IE 10 – CVE-2013-0322
Flash – CVE-2013-0634
Silverlight – CVE-2013-0074
Source:
It would have stopped the Java, Flash, and Silverlight drive-by attacks even if you had a vulnerable version installed.
The IE/browser based exploits can only be mitigated by keeping up to date or utilising something like EMET (although I don't really expect everyone to be running EMET).
PS - CVE-2013-0322 doesn't look like an IE10 issue.
My reasoning was that Google is bigger, therefore probably has better security. They also need very similar technology for securing the AdSense includes. Finally, if someone manages to compromise Google, there might be bigger problems than hosting a malware-d jQuery (although that would be pretty big).
It's not a very convincing reason, risk-wise, IMO. I'm assuming that jQuery should be pretty on top of the security of their CDN. Also that proposed new hash/integrity attribute for the SCRIPT tag seems way more promising.
It seems, that primary Windows PCs are targeted, but since also a Flash exploit is targeted, that also existed on Linux, it is not clear to me, if a Linux system could be infected.
I don't know, if I visited the site at this specific date, but I am rather sure, that if I was, I used a Linux system.
http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/
How many people Google a jquery function every day?
How many of those people were compromised (~6% conversion)?
How many machines were compromised and how many man hours will it take it re-secure?
In other words, plenty of people should care. You could argue that a modified version of jquery/jquery.min on CDNs would be more devastating, but both are bad news.