One of the issues that Google addressed earlier this week with the release of a new set of security patches for Android could render Nexus 9 devices vulnerable to malicious headphones, a team of security researchers reveals.
Tracked as CVE-2017-0510 and rated Critical severity, the security flaw is described as an elevation of privilege vulnerability in the kernel FIQ debugger that “could enable a local malicious application to execute arbitrary code within the context of the kernel.” The issue could lead to a local permanent device compromise, thus forcing users to reflash the operating system to repair the device.
The bug was found by Aleph Research, a team of ex-IBM X-Force researchers. Despite the unusual attack vector, the team was able to leak stack canaries, derandomize ASLR (address space layout randomization), conduct a factory reset, and even access HBOOT, which allowed them to communicate with internal System-on-Chips (SoCs).
In a blog post authored by Roee Hay, Aleph Research explains that attacks via multiplexed connectors were initially detailed in a BlackHat 2013 paper that focused mainly on USB ports and only briefly mentioned audio connectors. At the time, Nexus 4 was found to include a “TTL UART interface hidden in its headphone jack, a functionality which is enabled if the voltage on the MIC pin exceeds some threshold,” with all Nexus devices (Pixel too) known to have the functionality nowadays.
The researchers discovered that FIQ (Fast Interrupt Request) Debugger could be accessed on Nexus 9, although without a shell on production builds. Hay notes that “FIQ Debugger functionality is enabled even if the UART cable is inserted when the platform is up,” and explains that the supported commands allow for the exfiltration of a lot information by interacting with FIQ Debugger.
An attacker, Hay reveals, could dump the process list and can use the console command to view the kernel log and receive an unprivileged shell (on userdebug, eng builds only), or can dump the registers and call stack too.
“Unlike a normal debugger we cannot modify memory and/or place breakpoints, however since the FIQ preempts, the dumped information will be of an arbitrary process,” Hay explains.
The team then focused on discovering whether the attack vector could be used to leak sensitive information, and eventually succeeded in leaking the Stack Canary value of the Zygote process. Zygote is a process that contains system libraries and frameworks that almost all apps use, and which is shared between all Android apps (malware such as Triada was observed abusing Zygote to infect all processes).
The researchers were also able to prove that the attack can significantly weaken ASLR, because the vulnerability allows an attacker to view arbitrary CPU contexts with addresses included.
Next, they attempted to move beyond the limitation of the FIQ Debugger prompt, and were able to force a reboot to HBOOT from it, by entering the reboot oem-42 command. This boot mode allows an attacker to interact with I2C accessible SoCs, the researchers discovered. A factory reset could also be triggered, Hay notes.
“Google has patched the vulnerability by reducing the capabilities of the FIQ Debugger. When the platform is up, it’s no longer possible dump the registers nor reboot with an oem-N parameter (preventing reboots into HBOOT and Factory Resets). Issuing reboot oem-42 now results in a normal reboot,” the researcher concludes.
Related: Google Patches 35 Critical Android Vulnerabilities
Related: Security Bug Lurked in Nexus 9 Kernel for Two Years