Security Issues in Android (Custom ROM’s) was presented at c0c0n 2011. The talk explains what a custom ROM is and where aftermarket firmware comes from, then walks through the security-weak defaults commonly found in cooked ROMs, from USB debugging and ADB root mode to permissive system permissions, before closing with a proof-of-concept data theft tool and protection advice.
Summary
The agenda promised six stops: an introduction to the custom ROM concept, why a security review is needed, the security issues themselves, a proof-of-concept data theft tool, protection tips, and a demo. The talk started with the definition: an Android ROM is the OS firmware layer of the phone, generally consisting of the /system partition and sometimes /data, containing the kernel, Dalvik, libraries, framework, and vendor-provided applications.
Android basically has two kinds of firmware. Stock ROMs come pre-installed by manufacturers; custom ROMs are aftermarket versions not supported by the manufacturer, with CyanogenMod claimed as aftermarket firmware, MIUI Chinese by origin and mimicking iPhone looks, and OMFGB as a Gingerbread enhancement. The advantages slide explained the pull: mixing hardware and UI preferences, updates after carriers stop providing them, bleeding edge versions like 2.3.7, pre-rooted images, builds targeted at speed, gaming, performance, or battery, and overclocking. Sources included cyanogenmod.com, miui.org, the XDA forums, modaco, modmymobile, and many underground forums, with ROM cookers described as being in it for fun, profit, or the “they can” attitude.
The security case came from two directions: designing malware and exploits for Android is the next in thing, and employee pressure pushes Android into corporate infrastructure, with aftermarket distributions like CyanogenMod considered viable alternatives and work underway to implement them safely in corporate environments. Against that backdrop, the talk put seven practices under scrutiny: USB debugging enabled, ADB shell root mode, system permissions, installation from unknown sources, ADB shell over WiFi, SU access and settings, and custom recoveries.
Each practice got its own treatment. USB debugging allows pushing and pulling files, remounting system partitions, installing software without prompts, and fastboot with different kernels. ADB shell root mode is a special setting making adb run as root, activated at boot time through build.prop inside the boot image ramdisk, with a pointed aside about who pays attention to the other end of a charging dock. ADB over WiFi exposes the same shell over the wireless network via service.adb.tcp.port, and combined with ro.secure it effectively hands over the device, though the deck noted this was hypothetical with no known usage found so far. System permissions matter because /system should be read-only as the phone’s critical section, yet cookers were observed keeping 777 settings, and the slide invoked rootkits, trojans, and malware. Unknown source installation gets enabled by aftermarket forum practice, bypassing Android Market restrictions. SU access marks a rooted device, and default protection from unauthorized execution is limited, with Superuser.apk the only known protection. Custom recovery software provides unrestricted root access by default, and putting a phone into recovery mode is as simple as rebooting and pressing backspace or volume-down until recovery starts.
The proof-of-concept demo showed a data theft tool built on these weaknesses, deliberately not developed to a large extent to avoid script kiddie misuse. Protection advice split by audience: developers should avoid settings not required for normal users and recommend closing the unknown source setting; users should take a closer look at the development process, ask questions, and run the “Are You Insecure” audit tool, which got its own demo.
Key Themes
- The custom ROM ecosystem: ROM as the OS firmware layer (kernel, Dalvik, libraries, framework, vendor apps), stock versus custom firmware, examples like CyanogenMod, MIUI, and OMFGB, and the forums where cooked ROMs circulate.
- Why a security review is needed: rising Android malware and exploit design, employee pressure to integrate Android into corporate infrastructure, and CyanogenMod being treated as a viable corporate alternative without thorough security evaluation.
- Debugging interfaces left open: USB debugging with push/pull, remount, silent install, and fastboot; ADB shell root mode set at boot via build.prop; and ADB shell over WiFi combining with root to hand over the device.
- Filesystem permissions and install sources: /system should stay read-only but 777 permissions were observed, and aftermarket practice pushes users to enable unknown sources, bypassing market restrictions.
- SU access and custom recoveries: the SU binary signals a rooted device with Superuser.apk as the only known protection, while recovery images grant unrestricted root by default and are trivially reachable.
- Proof-of-concept data theft tool: a working demo against these weaknesses, intentionally limited in scope to avoid misuse.
- Protection recommendations: developers should avoid unnecessary settings and recommend closing unknown sources; users should examine the development process, ask questions, and run audit tooling.
Notable Points
- ROM definition: the OS firmware layer of the phone, generally the /system partition, possibly including /data, containing kernel, Dalvik, libraries, framework, and vendor-provided applications.
- Named examples: CyanogenMod (claimed as aftermarket firmware), MIUI (Chinese by origin, mimics iPhone looks), OMFGB (Gingerbread enhanced); sources included cyanogenmod.com, miui.org, forum.xda-developers.com, android.modaco.com, and modmymobile.com, plus underground forums.
- ROM cookers are described as being in it for fun, profit, or the “they can” attitude; advantages included updates after carrier support ends, bleeding edge 2.3.7, pre-rooted images, targeted builds, and overclocking or underclocking.
- Driver for the review: malware and exploit design for Android, employee pressure to integrate Android into corporate infrastructure, and ongoing work to implement CyanogenMod safely in corporate environments.
- USB debugging supports push/pull of files and folders, remounting system partitions, installation of software without prompts, and fastboot with different kernels.
- ADB shell root mode is a special boot-time setting: boot.img leads to ramdisk.cpio.gz and build.prop, with the deck asking whether anyone pays attention to the other end of a charging dock.
- ADB shell over WiFi runs at boot time or runtime via service.adb.tcp.port, and combined with ro.secure the user literally hands over the device; the deck flagged it as hypothetical with no known usage found so far.
- /system should be read-only as the critical section, but cookers were observed keeping 777 settings for /system, opening the door for rootkits, trojans, and malware.
- The SU binary is a direct indication of a rooted device; default protection from unauthorized execution is not available, and Superuser.apk is the only known protection; custom recovery software provides unrestricted root access by default, reachable by reboot then pressing backspace or volume-down until recovery starts.
- The demo data theft tool was intentionally not developed to a large extent to avoid a script kiddie approach; recommendations for users were to examine the development process, ask questions, and run the “Are You Insecure” tool, while organizations should audit ROM security settings before corporate approval.
Notable Quotes
“Do you pay attention to the other end of charging Dock. :)”
“Combine with our beloved ro.secure, you literally handover your device shouting : ”PLEASE OWN ME”.”
“Its observed at lots of places where Cooker’s keep 777 settings for /system”
“Remember ROOTKITS, TROJAN, MALWARE”
“With greater Power comes greater responsibility.”
“DEMO IS INTENTIONALLY NOT DEVELOPED TO A LARGE EXTEND TO AVOID SCRIPT KIDDIE APPROACH”