Most probably if you not using a top flagship Android smart phone or tablet for a top company like Google Motorola, Samsung, HTC or LG then you are using a smart phone with Android 4.3 Jelly Bean version running aboard. And if you are using the Android 4.3 Jelly Bean or earlier version run smart phone or tablet, you, or rather your smart phone/tablet is vulnerable to a serious code-execution vulnerability. This vulnerability was discovered by the Application Security Team of IBM, nine months ago. This vulnerability has been patched in the latest Android version from Google, the 4.4 KitKat version but Android 4.3 and older Android versions remain highly vulnerable.
As per the latest data available, only 13.6 % of total Android users have Kitkat on their smart phone or tablet. Which means that around 86.4 % of Android smart phones and tablets are vulnerable to this high risk vulnerability.
The IBM security researchers discovered that the stack buffer overflow vulnerability resides in the Androidโs KeyStore storage service, which is responsible for storing and securing deviceโs cryptographic keys.
โA stack buffer is created by the โKeyStore::getKeyForNameโ methodโ โThis function has several callers, which are accessible by external applications using the Binder interface (e.g., โandroid::KeyStoreProxy::getโ). Therefore, the โkeyNameโ variable can be controllable with an arbitrary size by a malicious application,โ Hay said. โThe โencode_keyโ routine that is called by โencode_key_for_uidโ can overflow the โfilenameโ buffer, since bounds checking is absent.โ explained the experts
Anybody with knowledge of Android API programming can successfully exploit this vulnerability. Once exploited the hacker can execute a malicious code under the keystore process. Once executed, such code can lead to serious leaking of the deviceโs lock credentials. Since the master key is derived by the lock credentials, whenever the device is unlocked, โAndroid::KeyStoreProxy::passwordโ is called with the credentials.
It can also leak decrypted master keys, data and hardware-backed key identifiers from the memory and encrypted master keys, data and hardware-backed key identifiers from the disk for an offline attack. The hackers can also remotely interact with the hardware-backed storage and perform crypto operations (e.g., arbitrary data signing) on behalf of the user.
An potential wannabe hacker can theoretically exploit the above vulnerability that exists in all the Android devices prior to the Android 4.4 Kitkat but experts believe that exploit is pretty hard to execute due to the presence of numerous difficulties likes the need to to bypass memory-based protections native to the operating system, including Data Execution Prevention (DEP) and Address Space Layout Randomization (ASLR). The Data Execution Prevention is an exploit mitigation that is used to prevent execution of malicious code, but the attackers have had success to bypass it using the Return Oriented Programming (ROP) attacks. The ASLR is used to mitigate buffer overflow attacks randomizing the memory locations used by system files and other programs, implementing this technique it is hard to guess the location of a given process.
โHowever, the Android KeyStore is respawned every time it terminates. This behaviour enables a probabilistic approach; moreover, the attacker may even theoretically abuse ASLR to defeat the encodingโ states the post.
The experts confirmed that they havenโt seen the flaw being exploited in the wild yet.