Cross-signed and malformed certificates can either crash ย or slowdown ย all Android devices including lollipop run ones
When A specially-constructed malformed certificate or a cross-signed ย is introduced into any Android device running, it may either slow down the device or crash it, ย forcing the user to reboot.
Wish Wu, aย mobile threat research engineer has published a report in this regard on TrendMicro blog.ย Wu says that Trend discovered this vulnerability in Android devices when researching the affects of ย how Android device handles cross-signed certificates are handled.
Trend says that their research found that all devices running on Android operating system release including the Google’s latest release, Android 5.1 lollipop fail to handle such malformed certificates. ย Malformed certificates are created when two certificates are signed with a looped certificate chain. Trend gives the example of ‘Certificate A’ ย being signed with ‘Certificate B’ and ‘Certificate B’ ย being signed with ‘Certificate A’ signs certificate B in a continuous loop.
The blog states that any suchย malformed certificate into the Android device either through a new App install or via importing the certificate directly, can cause the Android’s system to behave unexpectedly. ย Trend says that such Android device may either slow down or hang up forcing the user to reboot.
Table Of Contents
Vulnerability Description
Trend explains that this particular vulnerability is caused when a malformed certificate is introduced into the classes of Android framework and can be used by attackers. ย Android framework works on two common used classes, ย JarFile and KeyStore classes. ย Introducing the such a malformed certificate in any of these two classes can risk the device.
Android commonly used class
JarUtils (./libcore/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java)
These may be used by the JarFile class. It is used to verify a jar packageโs certificates and signature files. Unfortunately, the JarUtils class cannot properly deal with a loop certificate chain and falls into endless loop. The problem happens in all Android versions.
Android external KeyStore providersโ classes
(Such as ./external/bouncycastle/src/main/java/org/bouncycastle/jce/provider/JDKPKCS12KeyStore.java) โ These are used to process PKCS#12 file for the Android KeyStore. If the PKCS#12 file contains a loop certificate chain, the processing in the codes will also fall into endless loop.
Proof of Concept
The Researcherย has also given the PoC for this vulnerability on their blog. ย They have worked with two different scenarios
Scenario 1 : A specially crafted App is installed on a Android device.
we will install a new app signed by one of the above certificates. We create a new app called LoopCertsChain, signed by A.cert, and try to install it onto an Android device. (The screenshots below are on a device with Android 4.1.2, although versions up to 4.4 are affected.) We get the following UI, which never ends.
Upon closer examination, we find a key process (system_server) in Android keeps using up system resources until it is killed, which triggers a device reboot. The user has no choice in the matter.
Scenario 2 : Importing a malformed certificate on Android.
In the second scenario, we import a malformed PKCS#12 file with a loop certificate chain into Android.
TrendMicro says that in both the scenarios the Android device either locks in a infinite loop or gets stuck leaving the user with no alternative but to reboot the Android device.
TrendMicro says that that this vulnerability at present does not have any direct security worries for Google but cyber criminals can use this vulnerability in future to further their gains like running a arbitary code.
Trend has informed Google of this Android vulnerability and said that Google has not provided them with any time frame for the fix/patch for it.
Resource : TrendMicro Labs