Nytro Posted November 15, 2013 Report Posted November 15, 2013 Android 4.2.x Superuser Unsanitized EnvironmentAuthored by Kevin CernekeeVulnerable releases of several common Android Superuser packages may allow malicious Android applications to execute arbitrary commands as root without notifying the device owner. This advisoriy documents PATH and BOOTCLASSPATH vulnerabilities.Vulnerable releases of several common Android Superuser packages mayallow malicious Android applications to execute arbitrary commands asroot without notifying the device owner: - ChainsDD Superuser (current releases, including v3.1.3) - CyanogenMod/ClockWorkMod/Koush Superuser (current releases,including v1.0.2.1) - Chainfire SuperSU prior to v1.69The majority of third-party ROMs include one of these packages.On a rooted Android <= 4.2.x device, /system/xbin/su is a setuid rootbinary which performs a number of privilege checks in order todetermine whether the operation requested by the caller should beallowed. In the course of its normal duties, and prior to making theallow/deny decision, /system/xbin/su invokes external programs under aprivileged UID, typically root (0) or system (1000): - /system/bin/log, to record activity to logcat - /system/bin/am, to send intents to the Superuser Java app - /system/bin/sh, to execute the /system/bin/am wrapper script - /system/bin/app_process, the Dalvik VMThe user who invokes /system/xbin/su may have the ability tomanipulate the environment variables, file descriptors, signals,rlimits, tty/stdin/stdout/stderr, and possibly other items belongingto any of these subprocesses. At least two vulnerabilities arereadily apparent: - On ClockWorkMod Superuser, /system/xbin/su does not set PATH to aknown-good value, so a malicious user could trick /system/bin/am intousing a trojaned app_process binary: echo -e '#!/system/bin/sh\nexport PATH=/system/bin:$PATH\ntouch/data/trojan.out\nexec $0 "$@"' > app_process ; chmod 755 app_process PATH=`pwd`:$PATH su -c 'true'The PATH vulnerability is being tracked under CVE-2013-6768. - Other environment variables could be used to affect the behavior ofthe (moderately complex) subprocesses. For instance, manipulation ofBOOTCLASSPATH could cause a malicious .jar file to be loaded into theprivileged Dalvik VM instance. All three Superuser implementationsallowed Dalvik's BOOTCLASSPATH to be supplied by the attacker.The BOOTCLASSPATH vulnerability is being tracked under CVE-2013-6774.Sursa: Android 4.2.x Superuser Unsanitized Environment ? Packet Storm Quote