iOS Mobile Application Security – What Does Your Attack Surface Look Like?
As of May 2023, there were 1.76 million apps and 460 thousand games on the Apple AppStore. Applications do not always have to financially cost the end user, in-fact, majority would not cost a single penny. So where is the compromise, how can applications be offered at no cost and expected to be secure; are all applications in the store to be trusted, what information would be accessible if an application were to be misconfigured or what behaviors could be carried out if a malicious application were to make its way onto the device? Due to the absence of cost most users would not hesitate to install an application. This action would be taken without considering the impact on information exposure. As mentioned in a previous piece, application interaction often occurs within the first 30 minutes of a user’s day. Interactions have been integrated into routine and will happen without much thought. Developers and organisations strive to provide users with convenient and accessible functionality through applications. However, many developers fail to consider the potential security risks and organisations struggle to fully understand their security posture as a result. As with the Android security principles, to understand attack surface, we first need to understand the structure of an iOS application: iOS applications are a lot more complex than their Android counterparts. iOS applications do not have the ability to communicate directly with hardware. To carry out the communication, defined system interfaces or layers are used. These interfaces enable developers to write applications in a more efficient, and easier manner, to ensure application logic and functionality operates over various iOS versions and device types. Interfaces are provided in the form of special packages called frameworks. The role of a framework is to supply a directory that holds dynamic shared libraries containing files, resources such as nib files, images, and a helper application to support libraries. Layers contain frameworks that, as aforementioned, can be used to assist developers. There are four layers we need to be concerned about, summarised briefly below: Core Operating System Layer – Contains frameworks that could be used to leverage other existing technologies. Core Service Layer – Provides functionality including, but not limited to; in application purchases, access to contact lists, leveraging smart devices via homekit and location services. Media Layer – Used to provide graphics and audio. Cocoa Touch – Assists with user interaction with the application. The main functionality is user touch and motion, however, more exist. Figure 1 – iOS Layered Architecture Application developers have various options on how to approach the development via different application types: Native Hybrid Web Based Native iOS applications are going to be the focus, with specific focus being placed on an application called Damn Vulnerable iOS App-v2(DVIA v2). The application is written in Swift, and as the name suggests, is vulnerable by design. What is an application? At a basic level, iOS applications are compressed into an .IPA file which is an archive containing the relevant application files. The application data can be retrieved by renaming the file to <something>.zip and then extracted in the usual manner. Once complete the contents would become visible and be ready for analysis. iOS applications are uniquely sandboxed. By sandboxing it helps ensure that individual databases are used per application and segregation is occurring. By adopting this process, the chance of another application obtaining confidential information is reduced, however, not nullified. The iOS application contains three containers: Bundle Container – within this container all the application files are located in a designated folder when installed on the device. These will remain static in all resulting installations, on every iOS device, being identical. Important information would be located within this container and would help assist a threat actor in gaining a better understanding of potential attack surface. Data Container – contains unique data that is cached to assist with the running of the application. The files within the Data container would be continually changing to help remember data such as who has authenticated, what point the user stopped interacting so progress could resume from there or what data has been stored. These files should remain on the device until the application is removed. iCloud Container – Contains data stored within the iCloud that has been used by the application. If a user were to interact with one of these files on the application, subsequently, the data in iCloud should be updated to reflect these amendments. Example Misconfigurations When an iOS device has been compromised, a threat actor will look for target applications that would have the most financial gain, or greater chance of obtaining confidential data to carry out further attacks. Static assessment of files contained within the containers outlined above would occur along with dynamic analysis to identify an attack surface. Threat actors, along with supporting API issues, would look to identify misconfigurations within the application logic such as, but not limited to Jailbreak Detection Bypass – Jailbreak detection is often implemented on applications. Developers implement this to prevent threat actors leveraging further tools that could compromise confidential data or from reverse engineering the application. Despite this, there is often a way to bypass this protection exposing the complete attack surface. Local Data Storage Misconfigurations – Local data storage contains application, and user, specific data. This data often relates to authenticated users, developers leaving in hardcoded credentials or excessive permissions. If exploited, the confidentiality of this information would be impacted in a negative manner and the integrity of data would also suffer negatively. Touch/Face ID Bypass – Touch and Face ID can be used by application users to authenticate into the application, an example of this would be your banking application. If the protection were bypassed, the functionality behind would become accessible. This would result in impersonation of the user and funds being transferred to a threat actor-controlled account. Additionally, account details may be amended resulting in availability suffering along with confidentiality and integrity. Phishing – Creating a phishing prompt that would attempt
iOS Mobile Application Security – What Does Your Attack Surface Look Like? Read More »

























