Cross-Site Scripting Enabled On 1000 Major Sites (thestack.com) 54
An anonymous reader writes: A CloudFlare engineer has discovered that 1000 of the top one million websites, including bitcoin holding sites and trading sites, are running a default setting that enables cross-site scripting. This article details his examination of the top 1 million Alexa sites for evidence of compromised settings and finds that about 1000 of the sites on the list are capable of being compromised because of running a header called Access-Allow-Origin. He found the vulnerability while working on a legitimate use of domain-communication called Cross Origin Resource Sharing for the Stripe API. The header, which Johnson claims the vulnerable websites are outputting, is concluded with a wild-card asterisk, meaning that the sites in question are giving full permission for cross-domain communication via venerable protocols such as SOAP/AJAX XML exchanges.
Bad Summary (Score:3, Informative)
Bad summary, as usual. Access-Control-Allow-Origin: * explicitly forbids requests with credentials. Even if the host reflects the Origin domain in the Access-Control-Allow-Origin header, it must also send Access-Control-Allow-Credentials: true to be vulnerable.
https://annevankesteren.nl/2012/12/cors-101
Re:Bad Summary (Score:4, Interesting)
Not only that, this is not even Cross Site Scripting (XSS), but a straight up Cross Site Request Forgery (CSRF) even though XSS might be involved for this issue. XSS is where client-side scripts are injected directly into the response body of an affected website, typically through unescaped html input that gets rendered by web browsers belonged to victims who then make that subsequent client request. CSRF is where the victim's browser is told to do an action (via Javascript doing an asynchronous javascript/xml (AJAX) request) on the target's website by an unrelated website that the victim somehow visited, and sometimes this attack script is injected via XSS by attackers on a completely unrelated site. While XSS can be related, it is completely distinct to the CSRF issue which is what is being not properly mitigated against by these top websites (In fact, as parent said, they purposefully disabled this protection).
Re: (Score:2)
Re: Why does Slashdot use a "Taboola" or a "Janrai (Score:2)
Given that the web is an interconnected place, it isn't unreasonable to use resources from other hosts. That's been going on since at least '95. Sigh. Your objection is companies are using that to track you, allowing them to pay slashdot and others to keep websites running.
Venerable to SOAP (Score:2)
I told you to stop picking on us! Leave Slashdotters alone! Leave them alooooone! /cry
Re: (Score:2)
Re: (Score:2)
Oh crap, I totally read "vulnerable".
Re: (Score:2)
Access-Allow-Origin Header (Score:2)
Why are we trusting site X as to whether we should load XSS from it. Or better yet, why not just deny third-party scripts.
Re: (Score:2)
Exactly. Cross site scripting was bad from the beginning, and it only got worse when the advertising industry discovered how they could abuse it. Pretty much everything is blocked on my network. Screw the advertisers, and screw everyone who thinks that my bandwidth belongs to them. I want to read Slashdot, and that's all I want. If it becomes mandatory to load crap from third party sites, then I'll stop reading slashdot. It's that simple.
Re: (Score:2)
Re: (Score:2)
Well, I don't want 5000 sites to use jQuery. There's no reason for that much javascript.
Re: (Score:2)
The real issue is those 5000 sites don't want to serve me the file.
Re: (Score:2)
Upon reflection, my new answer is "yes". The performance hit is minimal (jQuery.js is small), the plethora of different versions means I would need a bunch on my system anyway, and websites shouldn't treat too much JS everywhere as something I subsidize, they should pay the full costs for their site.
The real issue is those 5000 sites don't want to serve me the file.
Horrible summary (Score:1)
Access-Control-Allow-Origin: * allows all the same information (less, actually) that you would normally need a proxy to access (i.e. making an AJAX request to the same domain, that gateways the request to a remote server). There's no security vulnerability here, so long as the websites are on the public Internet (and not behind a firewall/private intranet).
Re: (Score:3, Interesting)
Step away from the keyboard and stop giving security advice! That header lets any site load any content from that site, so if you are logged into with-header.example.com and you're looking at bigbadwolf.example, then bigbadwolf.example can impersonate you on with-header.example.com, because it can use your logged-in browser to access with-header.example.com, instead of accessing only the public information that it could get by accessing it from the server of bigbadwolf.example.
Am I misunderstanding? (Score:2)
Not just telemetry (Score:1)
Also vendor SDKs that are loaded from their canonical sources, etc...
Re: (Score:2)
> built around one of the worst programming languages around (JavaScript),
. /sarcasm But it such as bastion of good design. *snicker* You mean it being written in 10 days wasn't long enough? :-)
"JavaScript: Designing a Language in 10 Days" aka Javascript: 10 days for the designer, 10 years of frustrations about fucked up design for devs
* http://www.computer.org/csdl/m... [computer.org]
As Douglas Crockford, inventor of JSON, said about Automatic Semi-Colon Insertion [youtube.com]
1,000 of the top 1,000,000? (Score:1)
So, we are saying that .1% of web sites have this vulnerability?
And this is news?
Also the poster is worried about bitcoin, which has bigger problems than XSS?
lol
NoScript (Score:1)
Another reason to run NoScript, which blocks these kinds of shenanigans.
"The top one million websites"? (Score:2, Insightful)
That's a very large net to catch a not so sensational number. Look at it another way: that's 99.9% of the top one million websites *don't* "run a default setting that allows cross-site scripting".
Seriously, "top one million" means they're trawling pretty far down the pool to find these idiots.
Missing feature (Score:4, Insightful)
The problem is that Access-Allow-Origin cannot hold multiple value, which pushes developers to use * so that it works with more than one site
The right solution is to read the requester site name and return the Access-Allow-Origin header with it if it is in a whitelist. But that require a few extra line of coding.
Re: (Score:1)
The spec is short-sighted and should've been designed to allow multiple origins. The spec puts the onus of implementing support for multiple origins back on the server-side developer, when it would've been better implemented in the browser.
So what's new (Score:1)
Weak sauce stats usage (Score:1)
If you have to examine a million sites to find 1000 with that vulnerability, not only should you be trumpeting the fact that "...99.9% of the web is safe from this particular attack vector" (which doesn't sound NEARLY as inflammatory or click-baity) but you are also using a much broader definition of "major" in describing those websites.
I'd be willing to bet that once you get below the top 1000 on Alexa not many people consider anything in the rest of the "top 1,000,000 web sites" as "MAJOR".