Perimeter
5/4/2012
02:54 PM
John H. Sawyer
John H. Sawyer
Commentary
Connect Directly
RSS
E-Mail
50%
50%

Analyzing Android, iOS Apps For Weak Data Protection, Cleartext Passwords

Analysis reveals mobile apps designed to protect files and passwords do a poor job, often storing them in plain text and use weak obfuscation techniques.

In the last few blog posts, I covered an approach to mobile device security research based on techniques I've used over the years as a forensic investigator, network intrusion analyst, and penetration tester. I've described using mac-robber directly on Android and iOS devices, followed by mactime to generate a timeline of the filesystem as a basic method of identifying system activity that can find mobile app vulnerabilities. After covering how to get macrobber running on Android and iOS, I'm now going to show examples of vulnerable information that can be found through filesystem analysis, including some real-world examples.

Did you know that Android stores the preshared keys for wireless networks in cleartext? While this isn't news to most mobile researchers, I happened upon it again after I'd added a new WPA2-protected wireless network, and my timeline of the filesystem showed that /data/misc/wifi/wpa_supplicant.conf had recently changed. Major vulnerability? No, not at all, but it could be useful during a targeted attack if an attacker were able to steal a mobile device from the target or get malware onto the device to steal the keys.

I spent some time looking at applications designed to "protect" or "hide" specific images from your photo/image gallery. What surprised me were the methods for hiding the images. On Unix-based systems like Android (Linux) and iOS (Mac OS X), files and folders with names starting with a period (e.g., ".cantseeme") are considered hidden files. Most directory listing tools will not display them without passing specific parameters saying to list all files and folders including hidden ones. See where I'm going with this?

Yep. That's how several of the different photo "protection" apps work. For example, a timeline created after using PhotoSafe for Android showed that the following paths were used for storing thumbnails of all images it has loaded loaded and the files it hides, respectively:

  • /mnt/sdcard/com.camfiler.photosafe/.thumbnails/
  • /mnt/sdcard/com.camfiler.photosafe/.hide/

Thankfully, when I looked at PhotoSafe 2.8, it did include the following disclaimer:

PS is a software the changes photo files to hide them from the default photo gallery. Disclaimer: Do not use this for sensitive or important files.

While that's great, I doubt it's going to prevent people from actually using it to hide "sensitive and important files." But at least the developer is being honest. My guess is he may have already been called out for the weak protection measures used by the app and added the disclaimer to deal with it.

Gallery Lock Lite for Android does similar things but goes a step further to obfuscate the photos. After hiding a few photos, I created a timeline to see what was going on. I noticed a couple of new files and directories created. Of particular interest was another hidden directory, /mnt/sdcard/.gallery_lock/. Inside was a directory named media that contained a directory whose name was based on the date and time I hid the files. The files contained inside had two of each with the same base file name (e.g., 1331609828596), but with file extensions I didn't recognize: slt and slm.

I copied a pair of the files over to my laptop and used the file command to try and figure out what they were. The slm file was an unknown format and identified as just being raw data; however, the slt file turned out to be a JPG image file. When opened, it turned out to be a thumbnail of the original hidden image. Next, I ran the strings tool against the slm file to see if any interesting text strings showed up. Immediately, I saw the original filename of the file I'd hidden along with the string "Exif" that made me think the hidden photo might be inside this oddly named file.

Opening the file with a hex editor editor (Hex Fiend), I saw the original name of my hidden file followed by zeroes that filled the first 1,024 bytes of the file. After the zeroes, I recognized the beginning header of a JPG file -- bytes "FF D8." I selected the content of the file starting there on back to the end of the file where I saw the JPG footer (bytes "FF D9") and copied the content into a new file called carved.jpg. A quick check in an image viewer revealed this was indeed my "hidden" file.

To see screenshots from the process used during the Gallery Lock Lite analysis, see slides 19 and 20 (PDF) from my "Smart Bombs: Mobile Vulnerability and Exploitation" given at the SANS Mobile Device Security Summit.

During the joint version of the "Smart Bomb" talk (slides) that Tom Eston, Kevin Johnson, and I gave at the recent OWASP AppSecDC conference, we identified a few more issues that could lead to sensitive data exposure. For example, Evernote users that store sensitive information within Evernote might be surprised to know that some of the data may be stored in unencrypted files cached on the device even though only Premium users are supposed to be able to store data offline.

Similarly, MyFitnessPal for iOS stores sensitive personal data in cleartext in SQLite database files right on the Apple device. And Password Keeper "Lite," which is supposed to protect your passwords ... well, it stores the PIN and passwords in cleartext in a SQLite database file.

Of course, this only scratches the surface. There are hundreds of thousands of applications, and the ones we looked at only make up a small sampling of what's out there.

If there are apps you're considering using for sensitive data, either for personal use or in your enterprise environment, then I highly recommend you take the time to perform analysis to see whether they're adequately protecting your data.

John Sawyer is a Senior Security Analyst with InGuardians, Inc. The views and opinions expressed in this blog are his own and do not represent those of his employer. He can be reached at johnhsawyer@gmail.com and found on Twitter @johnhsawyer.

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
TBELL000
50%
50%
TBELL000,
User Rank: Apprentice
5/7/2012 | 2:36:22 PM
re: Analyzing Android, iOS Apps For Weak Data Protection, Cleartext Passwords
Great job John.-á This validates other securfity flaws I am reading about regarding the security weaknesses of the Andriod system.-á What is most concerning-mobile payments are migrating quickly to the Andriod and iOS platforms that are great targets for cyber crime.
Register for Dark Reading Newsletters
Partner Perspectives
What's This?
In a digital world inundated with advanced security threats, Intel Security seeks to transform how we live and work to keep our information secure. Through hardware and software development, Intel Security delivers robust solutions that integrate security into every layer of every digital device. In combining the security expertise of McAfee with the innovation, performance, and trust of Intel, this vision becomes a reality.

As we rely on technology to enhance our everyday and business life, we must too consider the security of the intellectual property and confidential data that is housed on these devices. As we increase the number of devices we use, we increase the number of gateways and opportunity for security threats. Intel Security takes the “security connected” approach to ensure that every device is secure, and that all security solutions are seamlessly integrated.
Featured Writers
White Papers
Cartoon
Current Issue
Dark Reading's October Tech Digest
Fast data analysis can stymie attacks and strengthen enterprise security. Does your team have the data smarts?
Flash Poll
Title Partner’s Role in Perimeter Security
Title Partner’s Role in Perimeter Security
Considering how prevalent third-party attacks are, we need to ask hard questions about how partners and suppliers are safeguarding systems and data.
Video
Slideshows
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2014-3366
Published: 2014-10-31
SQL injection vulnerability in the administrative web interface in Cisco Unified Communications Manager allows remote authenticated users to execute arbitrary SQL commands via a crafted response, aka Bug ID CSCup88089.

CVE-2014-3372
Published: 2014-10-31
Multiple cross-site scripting (XSS) vulnerabilities in the CCM reports interface in the Server in Cisco Unified Communications Manager allow remote attackers to inject arbitrary web script or HTML via unspecified parameters, aka Bug ID CSCuq90589.

CVE-2014-3373
Published: 2014-10-31
Multiple cross-site scripting (XSS) vulnerabilities in the CCM Dialed Number Analyzer interface in the Server in Cisco Unified Communications Manager allow remote attackers to inject arbitrary web script or HTML via unspecified parameters, aka Bug ID CSCup92550.

CVE-2014-3374
Published: 2014-10-31
Multiple cross-site scripting (XSS) vulnerabilities in the CCM admin interface in the Server in Cisco Unified Communications Manager allow remote attackers to inject arbitrary web script or HTML via unspecified parameters, aka Bug ID CSCuq90582.

CVE-2014-3375
Published: 2014-10-31
Multiple cross-site scripting (XSS) vulnerabilities in the CCM Service interface in the Server in Cisco Unified Communications Manager allow remote attackers to inject arbitrary web script or HTML via unspecified parameters, aka Bug ID CSCuq90597.

Best of the Web
Dark Reading Radio
Archived Dark Reading Radio
Follow Dark Reading editors into the field as they talk with noted experts from the security world.