4 ms·
In this case, if a company dies and a malicious actor gets the domain, there's not much they can do besides tell the browser to load those assets - but they cou
by icebraining 9y ago
In this case, if a company dies and a malicious actor gets the domain, there's not much they can do besides tell the browser to load those assets - but they could probably just take a copy of the original site and serve a copy of those assets themselves.
The attack might work the other way around: the attacker buys a bunch of domain names, serves "sleeper" malicious JS files with this on common paths (say, the paths used by Wordpress and other common CMSs), then releases the domain. When the new owner installs a CMS and start serving their site, the browser loads the malicious JS instead, which is now running under the new site's Origin (security context).
- prolurker 9y agoThat's an interesting attack vector, in the section 3 of the RFC they recommend to ignore the directive unless it's a secure connection which would mitigate that kind of problems. Another solution would be to use an unpredictable versioning scheme so the attacker can't anticipate the name of the resources.
- AgentME 9y agoThe attacker who buys a bunch of domains and legitimately owns them for a period of time wouldn't have any issue getting SSL certificates for them.
- prolurker 9y agoCorrect, but, even if not explicitly said, the cached entries should be associated to the certificate's fingerprint and immediately discarded once the certificate expires or is changed.
- asah 9y agoIsn't this also true for long cache control durations as well?
- icebraining 9y agoYes, although an immutable guarantee makes it more likely that the browser won't check for a new version.
- joosters 9y agoBut to make this attack work, browsers would have to visit this site before the new owner takes it over, in order to receive and cache the malicious JS. And if you can make people receive malicious JS, you've already got your attack vector - immutable caching isn't needed.
- icebraining 9y agoif you can make people receive malicious JS, you've already got your attack vector No, because a malicious JS file by itself can't do much. The attack vector is the malicious JS running on the new site, with permissions to steal session cookies and interact with the application. That's why caching without verification is important: to make sure the browser uses the cached malicious JS instead of fetching the new one.