The five top mobile app pitfalls – and how to avoid them
Stage 3: Sell
Ken Munro
16th July 2015
Share this:

We live in an ever-more mobile world and consumers are using apps on mobile more and more to deal with etailers. But apps can be prone to problems. Android may be the most successful mobile operating system, but it’s also perceived to be the most vulnerable. Estimates suggest up to 97% of mobile malware targets the platform with up to 5,000 strains detected each day. Many target the susceptibilities created by common coding practices.

And, with Gartner predicting demand will exceed internal capacity in the next two years, more and more companies will look to outsource app coding, making such shortcuts even more common.

Here are the top five pitfalls to avoid:

 

Common code can be easily deconstructed

Many apps are written in Java which is relatively easy to decompile and reverse engineer. As Java statements tend to easily map to predictable bytecode, it is easy to decompile them by looking for these known patterns and trying to match them back but there are ways to counter this.

Firstly, you could use a code obfuscator, such as the official Proguard plugin, which will mangle variable and method names to make them harder to understand. Or the second, preferred, option is to write your code in an open fashion and assume that the source code can be read. This works better as it generally means that architecture and security is introduced to the development process from the start. And a further word of warning: it’s never a good idea to include static credentials or encryption keys client side, particularly when the code can be so easily reversed.

 

Careless key management

Android has had a keystore since version 3.0, but most apps don’t use it, preferring to “roll their own”. These can often be found in the application’s sandbox either in text files or in a SQLite database. Even Android’s native email app does the same and Android stores wireless keys in plaintext too. So do bear this in mind given that side channel attacks, such as abusing bootloaders, use of hardware ports or malicious firmware, can be used to gain access to the application’s sandboxes.

 

Overly permissive permissions

The standard permission system has a set of granular defined permissions that can be requested by an app only at install time. This is generally a poor practice as it only gives the user one chance to choose whether to use the app or not. Consequently, many apps cast the net as widely as possible to cover themselves for future revenue streams but this can also expose the user who is providing far wider access to data on the device than is needed.

Some permissions, such as ACCESS_NETWORK_STATE, allow the app to discover things about the user’s device (such as the wireless SSID) that could be identifying, so it’s important to ensure that all data retrieved is appropriately secured or the app developer could be in breach of the Data Protection Act (DPA).

Ensure that you only request the permissions you actually need and ensure that there is a full business justification for each one. Ensure that this justification doesn’t include the phrase “because it’s easier”. Laziness generally does not improve security.

 

Erratic application of encryption

The amount of apps we come across that don’t use SSL or TLS is staggering, effectively exposing traffic between the mobile app and the service being consumed. Yes, SSL and TLS have their challenges, but that’s no excuse not to implement them. Sidestepping this protection mechanism makes a Man in the Middle (MitM) attack child’s play. A recent investigation into the app used to control the “My Friend Cayla” interactive child’s doll, for instance, found there was no SSL in place when it looked information up, allowing an attacker to easily introduce custom content to be spoken back.

 

Open access to external storage

Android was designed to use SD cards as cheap extra storage and by default media files are stored on external storage. (If there is no physical SD card slot, it is often emulated.) From Android 4.4 each app is assigned a working area on ‘external storage’ that they can use with no extra permissions. This means that apps on devices prior to 4.4 can read most data stored on external storage outside of an app’s working area. (After 4.4, the permission, READ_EXTERNAL_STORAGE is required to read this). So avoid the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions unless there is a full business justification.

  • Was this Helpful ?
  • Yes   No
Author: Ken Munro
Senior Partner, Pen Test Partners
Now read...
SaaS Shops vs. Open Source Shops: choosing the solution to start selling online
E-commerce is growing so fast that being present online is now essential for small and medium businesses. The different solutions to offer their products or services on the Internet are numerous:...
Featured eBooks
Copyright eSeller Publishing Limited © 2014
Connect with us
eSeller Media is the UK's leading channel for learning about selling in the digital age
eSeller partners
ePages Academy: All about your online business Register here now!
ePages Academy: All about your online business Register here now!