Trusted CA certificates can be used to perform Man-in-the-Middle (MITM) attacks (eavesdropping/modifying traffic) on SSL/TLS encrypted sessions. The integrity of SSL/TLS encrypted sessions is heavily dependent on safe handling of each trusted CA certificate. If a CA certificate gets compromised – or if it is misused, it can be used to issue a new server certificate for any DNS name (enabling a MITM scenario). A well-known example where this actually happened was DigiNotar.
I was asked to list the trusted CA certificates of iOS 5, Android 4.0 (ICS) and Windows Phone 7 for one of my customers – in order for them to understand what CA certificates their mobile users actually trust.
iOS and Windows Phone 7 is relatively easy, since both Apple and Microsoft lists the trusted certificates on their websites:
- iOS 5 trusted certs – 183 trusted CAs
- Windows Phone 7 trusted certs – 56 trusted CAs
Previously, Android used Bouncy Castle Provider to store all trusted certs in /system/etc/security/cacerts.bks. This file was a bit tricky to read on some devices, e.g. HTC had changed the original keystore password (Hmm, wonder why they don’t want us to read that file easily). In Android 4.0, the CA certificates are instead stored as separate files under the directory /system/etc/security/cacerts/.
Here is a simple way to write all issuer names to a file. The command-line assumes you have adb, e.g. from Android SDK – and grep (Windows users can use Cygwin or similar to get grep):
adb shell cat /system/etc/security/cacerts/* | grep Issuer: > trusted_roots_ICS.txt
The list contains 134 trusted CAs, compared to 183 trusted CAs on iOS 5. Both numbers sound pretty scary to me. Complete list of Android CAs can be found here. Luckily, we’re able to disable pre-installed CAs from the user interface in Android 4.0 – something that’s not possible in iOS 5. It will be interesting to see how/if Android manufacturers will modify the pre-installed CA list. Who do you trust?
Enjoy!
/Emil