by TazeTSchnitzel · 11y ago · 0 comments
Edit: ooh, take a look at the more detailed look from insight-labs: http://insight-labs.org/?p=1682
It's XMLHttpRequest ($.ajax), but with dataType: "script". Looking at the jQuery docs (http://api.jquery.com/jquery.ajax/):
"script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
Oh dear. If GitHub can detect this, GitHub can basically XSS all sites using Baidu's analytics.
Edit 2: Oh, the insight-labs article says the attack has stopped.
alert("WARNING: malicious javascript detected on this domain")
when you're trying to reach: https://github.com/greatfire/ or https://github.com/cn-nytimes/
That's why other people have started to notice it (as the article describes).Timeline of the attack looks something like this:
1. The Chinese firewall hijacks requests to http://hm.baidu.com/h.js and sends back a script that attacks GH instead.
2. Github notices that a huge amount of people are trying to reach https://github.com/greatfire/ and https://github.com/cn-nytimes/
3. GH figures out what's happening and starts replying with the alert javascript snippet.
4. Users are now getting noticed by the alert every time their browser runs the hijacked javascript.
5. The person that wrote this article writes this article after investigating what the alert message is about.
A attack reflection of sort.
Edit: You're technically not attacking you're reflecting if the attack stops there's nothing to reflect.
Just like in martial arts you don't just take a beating you defend and return the opponents attack back at them. Seems fair to me.
An eye for an eye would leave two people blind: the person who blinded the other, and the one that was blinded.
Once people start seeing the severe consequence of blinding someone (getting blinded back), they and everyone else would most likely stop, not continue blinding more people.
Why only one? :)
alert('......'); r_send = function(){}
What would be much more interesting is replacing <body> with a multi-lingual message explaining what's happening and how to block the Baidu script.