You’ve built modern mobile and rich internet applications (RIAs) that are sure to improve your business’ next major revenue stream. Conscious of security, you’ve ensured that the native application authenticates to the server, and you’ve run the app through a web application security scanner to identify weaknesses in the code. Those vulnerabilities have been remediated, and now you’re ready to go live.
Not so fast.
Despite your best intentions, chances are good your mobile and rich internet applications are going live with dangerous security flaws. Most traditional web application security scanners don’t provide the necessary protection when you’re dealing with modern application architectures, data formats and other underlying technologies. However, you can still build state-of-the-art rich internet applications with reliable and safe web application security by following these simple steps.
Step 1: Understand the application technologies and their security requirements
To make matters worse, attackers are finding new ways to exploit the back-end interfaces associated with mobile applications. Web application session management techniques fail to deliver the protection developers expect, and these old and insecure techniques do not stop attackers from tampering with the application, committing fraud or performing man-in-the-middle attacks.
That’s why it’s important to understand the technologies used in your applications so you can find an appropriate web application security scanner and/or supplement your scanning efforts accordingly.
Below is a list of the technologies that may require a more in-depth security solution:
- AJAX applications: JSON (JQuery), REST, GWT (Google WebToolkit)
- Flash remoting: Action Message Format (AMF)
- Back end of mobile apps powered by JSON, REST and other custom formats
- Web services: JSON, REST, XML-RPC, SOAP
- Complex application workflows: Sequences (shopping cart and other strict processes) and XSRF/CSRF tokens
Step 2: Look under the hood
There are two key qualities you should require of a web application security scanner that you plan to use for modern applications like mobile and rich internet applications. The first is the ability to import proxy logs. The second is an understanding of mobile application traffic, which enables the scanner to create attacks to test for security flaws. Vendors are often quick to advertise their scanners’ ability to be fed data from a proxy, but if the scanner is not familiar with JSON and REST, it will not be able to create attack variations – even when fed recorded traffic.
Like web application security scanners, traditional authentication methods fail to deliver the protection they once promised. While historically used to protect server-side mobile applications from SQL injection and cross-site scripting attacks, today’s authentication methods simply aren’t sophisticated enough to provide adequate web application security to new RIA’s and mobile apps. For example, attackers can exploit weak passwords when a scheme only authenticates the user and not the application. This can be avoided by using a client-side certificate to identify the application, but this isn’t feasible for all apps – especially customer-facing mobile apps.
Step 3: Determine whether your web application security scanner is capable
You can – and should – ask your web application security scanner provider what technologies the tool is able to scan. But don’t leave it at that – verify what they say is true. For instance, you can test for the security scanning coverage of an AJAX application by analyzing the request/response traffic. To do so, simply enable the scanner’s detailed logging feature, run the scanner through a proxy like Paros, Burp or WebScarab, and save the logs for manual review.
JSON also poses a unique challenge to web application security scanners. They must be able to decipher the new format and insert attacks to test the security of web application interfaces. A review of detailed logs of request/response traffic will indicate whether the scanner is fully capable of protecting rich internet applications like yours. However, not all scanners provide detailed logging. If this is the case, you will need to set up a proxy to capture traffic during the scan. Begin by scanning only a page that uses JSON, then check to see if the scanner requests include the JSON traffic and requests.
Step 4: Bolster testing efforts with the latest best practices
Attackers are increasingly targeting back-end servers. And while new mobile APIs like JSON create new ways to engage customers in rich internet applications, they also create new ways for attackers to reach back-end servers. The only way to discover and remediate API security flaws, authentication weaknesses, protocol-level bugs and load-processing bugs is with several rounds of testing. Also, understand that you cannot rely on SQL or basic authentication to protect the back end. Develop server-based applications to anticipate attacks by continually verifying the integrity of the application and uptime environment.
Finally, when developing mobile and RIAs, keep the following tips in mind:
- Data provided by the client should never be trusted.
- A device’s mobile equipment identifier should never be used to authenticate a mobile application, but do use multiple techniques to verify that requests are from the intended user.
- Since session tokens for mobile apps rarely expire, attackers can use them for a very long time.
- Credentials should not be stored in the application’s data store, local to the device.
- When requiring SSL, a valid certificate should be necessary.
Guaranteeing reliable web application security for mobile and rich internet applications and mobile apps can be tricky business. However, completing the proper research, choosing the right security scanner, and performing an ample amount of testing will help detect vulnerabilities and ward off new attacks, allowing your application to be successful in the marketplace.