News for hackers. Stuff that matters.
Re:Alibaba Cloud by JohnTHaller on Friday July 14, 2017 @09:36AM (#14769651)
Don't serve any javascript from within China to users outside of China. Remember when the Chinese government used the great firewall of China to modify Baidu analytics javascript passing through it to setup an international DDoS against github? Hosting your stuff in mainland China for consumption outside make you a party to that happening again in the future.
Re:Alibaba Cloud by apetresc on Friday July 14, 2017 @10:21AM (#14769983)
Why would it matter? Surely if the Chinese government was able to MITM the JS to do bad stuff, they could also MITM the HTML to serve Javascript even if you originally weren't?
Re:Alibaba Cloud by computerex on Friday July 14, 2017 @11:57AM (#14770784)
So don't serve any content from China, is what I am hearing.
Re:Alibaba Cloud by zhte415 on Friday July 14, 2017 @01:40PM (#14771639)
We'll, you can't host from mainland - big distinction, mainland HK is far more liberal and long let that be supported - without an ICP licence.

An ICP licence is issued according to mainland policy, requirements bot exclusive to including having legal entity/people and agreeing to be part of the Golden Shield which extends far from China's firewall but also personal information tracking, both online and offline.

Re:Alibaba Cloud by noir_lord on Friday July 14, 2017 @12:07PM (#14770874)
I trust the chinese government less than western governments.

And I don't trust them much either but at least they answer to corporations if not the people.

Re:Alibaba Cloud by EduardoBautista on Friday July 14, 2017 @05:27PM (#14773343)
They just let someone die in prison for fighting for human rights.
Re:Alibaba Cloud by JohnTHaller on Friday July 14, 2017 @11:23AM (#14770490)
Very true. Heck, China could also modify images to take advantage of vulnerable libraries.
Re:Alibaba Cloud by cakeface on Friday July 14, 2017 @01:12PM (#14771378)
I feel like this is just another reason to use subresource integrity on your includes. If you are only pulling javascript and your HTML is served outside of China you can ensure the correctness of the response.
Re:Alibaba Cloud by taf2 on Friday July 14, 2017 @01:18PM (#14771435)
Doesn't the resource still need to be requested to perform the integrity check? If I recall correctly the script was being redirected to a github gist which is why it was effectively a DDOS on github... so yes sub-resource integrity is great but wouldn't protect against this type of attack since the requester was the target of the attack but rather the source...
Re:Alibaba Cloud by JohnTHaller on Sunday July 16, 2017 @03:20PM (#14783679)
This particular attack had China inserting a javascript reloader into Baidu's javascript file to hit the two github projects they didn't like to perpetrate the DDoS. So, it wasn't just a redirect.
Re:Alibaba Cloud by dfguo on Friday July 14, 2017 @09:58AM (#14769799)
Since then, Baidu has been serving most of their assets through https to prevent hijacking.
Re:Alibaba Cloud by CobrastanJorji on Friday July 14, 2017 @01:03PM (#14771311)
How confident are you that the Chinese government does not have the SSL keys for Baidu? Because I am 0% confident.
Re:Alibaba Cloud by willstrafach on Friday July 14, 2017 @11:36AM (#14770603)
Worth pointing out that it was not GFW which performed the man-in-the-middle, it was a separate system: https://citizenlab.ca/2015/04/chinas-great-cannon/
Re:Alibaba Cloud by Cthulhu_ on Friday July 14, 2017 @12:40PM (#14771159)
This is why there needs to be a system where hashes for JS files can be securely installed in browsers for verification.
Re:Alibaba Cloud by mikegerwitz on Friday July 14, 2017 @01:11PM (#14771369)
I want to see native support for content-level cryptographic signatures in browsers. I also want it to be able to use a local GPG keyring, so I can validate against my chosen web of trust. JavaScript programs are just that---programs. When I use my package manager, or when I download a package online, I have a signature to verify against---either automatically (former) or manually (latter); https does not solve that.

This is different than the CA system, which verifies the _server_, not the content being served. A compromised server or successful MitM allows an attacker to modify data undetected.

This is also different from subresource integrity---it's a step in the right direction, but that only helps with third-party resources being loaded, and it doesn't at all help with cryptographic signatures.

Having signatures also helps with the case of programs constantly being updated outside the users' control. JavaScript programs are almost always ephemeral---they load with a webpage, and disappear when you leave, barring certain caching. "Updates" aren't really updates---you are re-downloading the program every time. So, hashes will change, and without cryptographic signatures, you can't be sure whether the new hash should even be trusted.

As a separate benefit, this support would also be useful for authentication online and asserting one's identity on e.g. social media, especially decentralized/federated services.

Re:Alibaba Cloud by victor871129 on Friday July 14, 2017 @12:52PM (#14771229)
It exists, is called SSL
Re:Alibaba Cloud by IshKebab on Friday July 14, 2017 @11:51AM (#14770729)
It's https.