Lucene search
+L

Android Debug Bridge Traversal

🗓️ 14 Jun 2013 00:00:00Reported by Ariel BerkmanType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 24 Views

Android Debug Bridge Backup/Restore Traversal Vulnerabilit

Code
`Hi,  
  
adb (Android Debug Bridge) backup/restore allows you to backup and restore  
applications via adb, including system applications.  
  
The backed up files are stored in tar.zlib (named .ab by default) files.  
"adb restore" is vulnerable to a directory traversal attack. By creating a  
file named "apps/com.andoird.settings/db/../../../local.prop" inside the  
backup file, the restore operation would restore the file onto  
/data/local.prop (rather than  
/apps/apps/com.android.settings/databases/...).  
The "apps","com.android.setttings" and "db" directory names are extracted  
for determining the package name and the directory (db=>database) to  
restore the relevant file onto, and everything that  
follows is expected to be the filename.  
  
This vulnerability is not specific to com.android.settings (demonstrated  
below), but rather any system application that support backup and restore.  
  
One can use this vulnerability for escalating privileges to root on Android  
phones supporting adb backup/restore (for example) as follows:  
  
  
# tested on HTC phone with android 4.0.4. This will likely work on other  
configurations as well with some modifications.  
  
# backup your settings app, before we overwrite its files.  
adb backup -f settings.ab com.android.settings  
(select approve to begin backup)  
  
# restore the malformed backup file, which will create /data/local.prop  
(with ro.kernel.qemu=1) -- attached to this email.  
adb restore special.ab  
  
# restart the phone.  
  
adb shell  
  
# adb should now run as root.  
# install SU, or create a setuid root shell somewhere.  
# delete /data/local.prop  
  
# the malformed backup file will likely break you settings app, so expect  
some oddities until it's all restored.  
adb restore settings.app  
  
Bin4ry and later Saurik had used a race condition in "adb restore" (  
http://forum.xda-developers.com/showthread.php?t=1886460) to gain root,  
while this attack also uses adb restore, it uses a different attack vector,  
and does not involve any race conditions.  
  
Thanks,  
Ariel.  
  
--  
Recover Information Technologies LTD.  
http://www.recover.co.il  
Office #: 09-9568644  
Mobile #: 0544-426554  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

14 Jun 2013 00:00Current
0.4Low risk
Vulners AI Score0.4
24