Fraunhofer Institute researchers are working to speed up the scanning of mobile app code for security flaws, aiming to offer developers in a few milliseconds the kind of analysis that once required an all-night scan of code.
In fact, the researchers are showing not one but three tools to evaluate or enhance the security of mobile apps at the Cebit trade show in Hanover, Germany, this week, the other two intended to detect flaws in already-deployed apps.
Appicaptor is a service to help businesses identify apps that threaten security or that could breach corporate data-protection policies, while App-Ray, which performs similar functions, is available either as a hosted service or as a virtual machine IT departments can deploy on their own servers.
The CodeScan tool for developers, meanwhile, is still a prototype. The researchers are still adding to its ability to identify flaws in code through a combination of static and dynamic scanning.
"It's designed for Java, but since Android apps are basically written in Java, you can use it for Android as well," said Eric Bodden of the Fraunhofer Institute for Secure Information Technology.
Like other code-scanning tools on the market, it runs within the IDE (Integrated Development Environment), he said. However, existing tools are either too coarse-grained, analyzing only one method at a time with limited functionality, or too slow, uniformly scanning the entire code overnight on a powerful server, and so making instant feedback impossible.
With CodeScan, Bodden, said, "We aim to do that degree of analysis in a few milliseconds, as you save your code."
To do that, the researchers look for the most dangerous flaws in the riskiest code first, rather than analyzing all the code to the same depth.
"One mistake we find a lot is when people use symmetric cryptography, algorithms where you use the same key to encrypt and decrypt data," Bodden said. "The thing you should absolutely not do in that context is embed the key in your code," because that will give attackers all they need to intercept communications in both directions, he said. "We can find usages of those APIs very quickly and then perform a specific analysis looking for embedded encryption keys."
"Another big area we are looking into is privacy leaks, including sensitive data like passwords," Bodden said. While still working on an app, developers typically have it log data about its status as it executes. "That's OK in development, but you shouldn't ship such code because logs can be ready by many other apps," he said. By performing data flow analysis, CodeScan can see if password data is flowing to log files.
"Most errors are in the misuse of APIs or in the area of data flow," he said.
Not all the security and privacy threats posed by mobile apps are unintentional: Many of them incorporate third-party ad modules that track user behavior. "We did a test of the top 400 apps and found there's a huge zoo of trackers out there. All those companies can get information on you if you used the apps," said Jens Heider, head of Fraunhofer Institute's mobile security test lab.
The Appicaptor service provides regular scans of iOS, Android, Windows Phone and BlackBerry apps to warn when they include such functions. Businesses can subscribe to a report about the security of up to 100 apps for a!1,500 (US$2,100) per month, including the purchase cost of up to a!5 per app. For a!5,000 per month the service will report weekly on how up to 500 apps comply with a security policy defined by the customer, Heider said.
At the Fraunhofer Institute for Applied and Integrated Security another team has developed App-Ray, a security scanner for Android apps that can be used by businesses policing their bring-your-own-device security policy, or by developers curious about what unexpected or unwanted functions the third-party modules they use may have brought with them.
"We find stuff that is not problematic per se, but may be a problem in a company environment," said Dennis Titze, one of the researchers involved. For example, an app that can record audio may not in itself be bad -- Whatsapp can record 10-second clips to send as messages, for instance -- but combined with the ability to access the calendar and activate the microphone when the phone's owner is attending a meeting, it may become a security risk, he said.
App-Ray also detects threats inherent in what the app doesn't do, rather than what it does, such as insecure SSL certificate checking: "We look at an app's byte code to see if it implements its own trust manager, [rather than the standard APIs] and whether it looks like this does something. Many apps have a certificate check function that doesn't have any code in it, it just returns."
App-Ray is ready for commercial use, and the lab is looking at two pricing models, Titze said. An on-premises version, available as a virtual machine image, would cost somewhere between a!10,000 and a!100,000 a year, allowing businesses to test as many apps as they wish with no one else aware of which applications they are concerned about. This could be an advantage for a developer, for instance, looking for security risks in new versions of its apps before uploading them to an online market. A hosted version would cost between a!100 and a!1000 a month, he said.
Peter Sayer covers open source software, European intellectual property legislation and general technology breaking news for IDG News Service. Send comments and news tips to Peter at firstname.lastname@example.org.