China, GitHub and the man-in-the-middle
en.greatfire.org
en.greatfire.org
> More the latter
Sooooooo I guess employees have to resort to the old "micro SD card in your shoe" technique...
Or just use a tunneling proxy.
I guess I could set up OpenVPN on a VPS or something.
So if you want to watch the traffic, it should be as simple as MITMing yourself with a cert you add to the Chrome trust DB.
It would be slightly more palatable if the firewall did cert validation on the other side of things… but they don't.
We agree about pinning.
As pinning becomes more widespread, browsers that support it will become a sort of surveillance network for forged certificates. That's effectively what caused the Turktrust discovery.
You're correct that this won't protect against a MITM during this first visit and will cause confusion if an attacker pins his fraudulent public key. However, I would argue that pinning provides a large net security gain in practice. The same model of vulnerable initial visit but secure subsequent visits is used in HSTS to prevent ssl stripping attacks.
[In other words, people want cert-pinning with a distributed pin cache to prevent initial-session MITM. But they don't know that.]
"At around 8pm, on January 26, reports appeared on Weibo and Twitter that users in China trying to access GitHub.com were getting warning messages about invalid SSL certificates. The evidence, listed further down in this post, indicates that this was caused by a man-in-the-middle attack."
"The attack happened on a Saturday night. It was very crude, in that the fake certificate was signed by an unknown authority and bound to be detected quickly. The attack stopped after about an hour."
"While the attack was short-lived, it is possible that passwords of many GitHub users were recorded. It’s also possible that the IP addresses of users accessing certain URLs, such as these lists of GFW [Great Firewall] contributors, were tracked."
"HTTPS effectively disables half of what the Great Firewall can do. We have argued for a long time that the reason that Gmail isn’t fully blocked is that it’s considered too important and that the backlash against closing down access would be too great. ... It now appears that GitHub has been added to this list. ... With every website that switches to HTTPS, the authorities’ options are limited to two: completely blocking it, or completely allowing it. The more they fear a public reaction to complete blocks, the fewer their options become. Man-in-the-middle attacks are likely to become increasingly tempting."
"No browser would prevent the authorities from using their ultimate tool though: certificates signed by the China Internet Network Information Center. CNNIC is controlled by the government through the Ministry of Industry and Information Technology. They are recognized by all major browsers as a trusted Certificate Authority. If they sign a fake certificate used in a man-in-the-middle attack, no browser will warn of any usual activity."
That is the important part. I am surprised China isn't doing this already. Maybe they are doing so, but only for targeted attacks. The CA community really shouldn't grant China any CA authority whatsoever...
It's not complicated, anyway. At least in Firefox it's just a menu option in Preferences -> Advanced -> Encryption -> View Certificates.
So the Chinese authorities probably save this possibility as a measure of last resort. Instead of encouraging everyone to look for a safer alternative than SSL.
Turns out the guy who uploaded the packet capture file was @chenshaoju
$ SITE=en.greatfire.org
$ echo "HEAD / HTTP/1.0\n Host: $SITE:443\n\n EOT\n" | openssl s_client -prexit -connect $SITE:443
I'm not sure how to interpret the results, but I'd be thrilled if someone more knowledgeable would comment. I see there is this chain of certs: Certificate chain
0 s:/OU=Domain Control Validated/OU=PositiveSSL/CN=greatfire.org
i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
1 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
2 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
and openssl seems to complain about a self-signed certificate: Verify return code: 19 (self signed certificate in certificate chain)