The
iOS
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also include ...
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
utilizes many security features in both
hardware
Hardware may refer to:
Technology Computing and electronics
* Electronic hardware, interconnected electronic components which perform analog or logic operations
** Digital electronics, electronics that operate on digital signals
*** Computer hard ...
and
software
Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work.
...
, from the boot process to biometrics.
Secure Boot
Before fully booting into iOS, there is low-level code that runs from the
Boot ROM
The boot ROM is a type of ROM that is used for booting a computer system. There are two types: a mask boot ROM that cannot be changed afterwards and a boot EEPROM, which can contain an UEFI implementation.
Purpose
Upon power up, hardware usuall ...
. Its task is to verify that the Low-Level
Bootloader
A bootloader, also spelled as boot loader or called boot manager and bootstrap loader, is a computer program that is responsible for booting a computer.
When a computer is turned off, its softwareincluding operating systems, application code, an ...
is signed by the Apple
Root
In vascular plants, the roots are the organs of a plant that are modified to provide anchorage for the plant and take in water and nutrients into the plant body, which allows plants to grow taller and faster. They are most often below the sur ...
CA public
key
Key or The Key may refer to:
Common meanings
* Key (cryptography), a piece of information that controls the operation of a cryptography algorithm
* Key (lock), device used to control access to places or facilities restricted by a lock
* Key (ma ...
before running it. This process is to ensure that no malicious or otherwise unauthorized software can be run on an iOS device. After the Low-Level Bootloader finishes its tasks, it runs the higher level bootloader, known as
iBoot
iBoot is the stage 2 bootloader for all Apple products. It replaces the old bootloader, BootX. Compared with its predecessor, iBoot improves authentication performed in the boot chain.
For x86 macOS, the boot process starts by running code sto ...
. If all goes well, iBoot will then proceed to load the iOS kernel as well as the rest of the operating system.
Secure Enclave
The Secure Enclave is a
coprocessor found in iOS devices part of the A7 and newer chips used for data protection. It includes the user data pertaining to
Touch ID
Touch ID is an electronic fingerprint recognition feature designed and released by Apple Inc. that allows users to unlock devices, make purchases in the various Apple digital media stores (iTunes Store, App Store, and Apple Books Store), and ...
,
Face ID
Face ID is a facial recognition system designed and developed by Apple Inc. for the iPhone and iPad Pro. The system allows biometric authentication for unlocking a device, making payments, accessing sensitive data, providing detailed facial exp ...
, and
Apple Pay
Apple Pay is a mobile payment service by Apple Inc. that allows users to make payments in person, in iOS apps, and on the web. It is supported on these Apple devices: iPhone, Apple Watch, iPad, and Mac. It digitizes and can replace a c ...
, among other sensitive data.
The purpose of the Secure Enclave is to handle keys and other info such as biometrics that is sensitive enough to not be handled by the Application Processor (AP). It is isolated with a hardware filter so the AP cannot access it.
It shares RAM with the AP, but its portion of the RAM (known as TZ0) is encrypted. The secure enclave itself is a flashable 4 MB AKF processor core called the secure enclave processor (SEP) as documented i
Apple Patent Application 20130308838 The technology used is similar t
ARM's TrustZone/SecurCorebut contains proprietary code for Apple KF cores in general and SEP specifically. It is also responsible for generating the UID key on A9 or newer chips that protects user data at rest.
It has its own secure boot process to ensure that it is completely secure. A hardware
random number generator
Random number generation is a process by which, often by means of a random number generator (RNG), a sequence of numbers or symbols that cannot be reasonably predicted better than by random chance is generated. This means that the particular outc ...
is also included as a part of this coprocessor. Each device's Secure Enclave has a unique ID that is fused into the SoC at manufacturing time and cannot be changed. Starting with
A9 devices, the unique ID is generated by the Secure Enclave's random number generator and is never exposed outside of the device. This identifier is used to create a temporary key that
encrypts
In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can decip ...
the
memory
Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembered ...
in this portion of the system. The Secure Enclave also contains an anti-replay counter to prevent
brute force attacks.
The SEP is located in the devicetree under IODeviceTree:/arm-io/sep and managed by the AppleSEPManager driver.
In 2020, security flaws in the SEP were discovered, causing concerns about Apple devices such as iPhones.
Face ID
Face ID is a face scanner that is embedded in the notch on
iPhone models
X,
XS,
XS Max,
XR,
11,
11 Pro,
11 Pro Max,
12,
12 Mini,
12 Pro,
12 Pro Max,
13,
13 Mini,
13 Pro,
13 Pro Max,
14, and the
14 Plus. On the
iPhone 14 Pro
The iPhone 14 Pro and iPhone 14 Pro Max are smartphones designed, developed, and marketed by Apple Inc. They are the sixteenth-generation flagship iPhones, succeeding the iPhone 13 Pro and iPhone 13 Pro Max. The devices were unveiled alongsi ...
,
14 Pro Max,
iPhone 15
The iPhone 15 and iPhone 15 Plus are smartphones designed, developed, and marketed by Apple Inc. They are the seventeenth and current generation of iPhones, succeeding the iPhone 14 and iPhone 14 Plus. The devices were announced on Septemb ...
,
iPhone 15 Plus,
iPhone 15 Pro
The iPhone 15 Pro and iPhone 15 Pro Max are smartphones designed, developed, and marketed by Apple Inc., Apple Inc. They are the List of iPhone models, seventeenth-generation flagship iPhones, succeeding the iPhone 14 Pro, iPhone 14 Pro and iPh ...
, and
iPhone 15 Pro Max, it is embedded in the
Dynamic Island. It can be used to unlock the device, make purchases, and log into applications among other functions. When used, Face ID only temporarily stores the face data in encrypted memory in the Secure Enclave, as described above. There is no way for the device's
main processor
A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
or any other part of the system to access the raw data that is obtained from the Face ID sensor.
Passcode
iOS devices can have a passcode that is used to unlock the device, make changes to system settings, and encrypt the device's contents. Until recently, these were typically four numerical digits long. However, since unlocking the devices with a fingerprint by using Touch ID has become more widespread, six-digit passcodes are now the default on iOS with the option to switch back to four or use an alphanumeric passcode.
Touch ID
Touch ID is a fingerprint scanner that is embedded in the home button and can be used to unlock the device, make purchases, and log into applications among other functions. When used, Touch ID only temporarily stores the fingerprint data in encrypted memory in the Secure Enclave, as described above. Like Face ID, there is no way for the device's
main processor
A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
or any other part of the system to access the raw fingerprint data that is obtained from the Touch ID sensor.
Address Space Layout Randomization
Address Space Layout Randomization (ASLR) is a low-level technique of preventing
memory corruption
Memory corruption occurs in a computer program when the contents of a memory location are modified due to programmatic behavior that exceeds the intention of the original programmer or program/language constructs; this is termed as violation of m ...
attacks such as
buffer overflow
In information security and programming, a buffer overflow, or buffer overrun, is an anomaly whereby a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory locations.
Buffers are areas of memor ...
s. It involves placing data in randomly selected locations in memory in order to make it more difficult to predict ways to corrupt the system and create exploits. ASLR makes app bugs more likely to crash the app than to silently overwrite memory, regardless of whether the behavior is accidental or malicious.
Non-executable memory
iOS utilizes the
ARM architecture
ARM (stylised in lowercase as arm, formerly an acronym for Advanced RISC Machines and originally Acorn RISC Machine) is a family of reduced instruction set computer (RISC) instruction set architectures for computer processors, configure ...
's
Execute Never (XN) feature. This allows some portions of the memory to be marked as non-executable, working alongside ASLR to prevent buffer overflow attacks including
return-to-libc attack
A "return-to-libc" attack is a computer security attack usually starting with a buffer overflow in which a subroutine return address on a call stack is replaced by an address of a subroutine that is already present in the process executable memory, ...
s.
Encryption
As mentioned above, one use of encryption in iOS is in the memory of th
Secure Enclave When a passcode is utilized on an iOS device, the contents of the device are encrypted. This is done by using a hardware
AES
AES may refer to:
Businesses and organizations Companies
* AES Corporation, an American electricity company
* AES Data, former owner of Daisy Systems Holland
* AES Eletropaulo, a former Brazilian electricity company
* AES Andes, formerly AES Gener ...
256 implementation that is very efficient because it is placed directly between the
flash storage
Flash memory is an electronic non-volatile computer memory storage medium that can be electrically erased and reprogrammed. The two main types of flash memory, NOR flash and NAND flash, are named for the NOR and NAND logic gates. Both us ...
and RAM.
iOS, in combination with its specific hardware, uses
crypto-shredding
Crypto-shredding is the practice of 'deleting' data by deliberately deleting or overwriting the encryption keys.
This requires that the data have been encrypted. Data may be considered to exist in three states: data at rest, data in transit and ...
when erasing all content and settings by
obliterating all the keys in '
effaceable storage'. This renders all user data on the device cryptographically inaccessible.
Keychain
The iOS keychain is a
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases spa ...
of login information that can be shared across apps written by the same person or organization.
This service is often used for storing passwords for web applications.
App security
Third-party applications such as those distributed through the App Store must be code signed with an Apple-issued
certificate
Certificate may refer to:
* Birth certificate
* Marriage certificate
* Death certificate
* Gift certificate
* Certificate of authenticity, a document or seal certifying the authenticity of something
* Certificate of deposit, or CD, a financial pr ...
. In principle, this continues the
chain of trust
In computer security, a chain of trust is established by validating each component of hardware and software from the end entity up to the root certificate. It is intended to ensure that only trusted software and hardware can be used while still ...
all the way from the Secure Boot process as mentioned above to the actions of the applications installed on the device by users. Applications are also
sandboxed, meaning that they can only modify the data within their individual
home directory
A home directory is a file system directory on a multi-user operating system containing files for a given user of the system. The specifics of the home directory (such as its name and location) are defined by the operating system involved; for ...
unless explicitly given permission to do otherwise. For example, they cannot access data owned by other user-installed applications on the device. There is a very extensive set of privacy controls contained within iOS with options to control apps' ability to access a wide variety of permissions such as the camera, contacts, background app refresh, cellular data, and access to other data and services. Most of the code in iOS, including third-party applications, runs as the "mobile" user which does not have
root privileges. This ensures that system files and other iOS system resources remain hidden and inaccessible to user-installed applications.
App Store bypasses
Companies can apply to Apple for enterprise developer certificates. These can be used to sign apps such that iOS will install them directly (sometimes called "
sideloading
Sideloading describes the process of transferring files between two local devices, in particular between a personal computer and a mobile device such as a mobile phone, smartphone, PDA, tablet, portable media player or e-reader.
Sideloading t ...
"), without the app needing to be distributed via the App Store.
The terms under which they are granted make clear that they are only to be used for companies who wish to distribute apps directly to their employees.
Circa January–February 2019, it emerged that a number of software developers were misusing enterprise developer certificates to distribute software directly to non-employees, thereby bypassing the App Store. Facebook was found to be abusing an Apple enterprise developer certificate to distribute an application to underage users that would give Facebook access to all
private data
Information privacy is the relationship between the collection and dissemination of data, technology, the public expectation of privacy, contextual information norms, and the legal and political issues surrounding them. It is also known as data pr ...
on their devices.
Google
Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
was abusing an Apple enterprise developer certificate to distribute an app to adults to collect data from their devices, including unencrypted data belonging to third parties.
Certificates are also used by services such as
AltStore,
AppValley
AppValley is an independent American digital distribution service operated and trademarked by AppValley LLC. It serves as an alternative app store for the iOS mobile operating system, which allows users to download applications that are not availa ...
, Panda Helper, TweakBox and TutuApp to distribute apps that offer
pirated software
Copyright infringement (at times referred to as piracy) is the use of works protected by copyright without permission for a usage where such permission is required, thereby infringing certain exclusive rights granted to the copyright holder, s ...
.
Network security
iOS supports
TLS with both low- and high-level
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
s for developers. By default, the App Transport Security (ATS) framework requires that servers use at least TLS 1.2. However, developers are free to override this framework and utilize their own methods of communicating over networks. When Wi-Fi is enabled, iOS uses a randomized
MAC address
A media access control address (MAC address) is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment. This use is common in most IEEE 802 networking tec ...
so that devices cannot be tracked by anyone
sniffing wireless traffic.
Two-factor authentication
Two-factor authentication is an option in iOS to ensure that even if an unauthorized person knows an
Apple ID
Apple ID is an authentication method used by Apple for iPhone, iPad, Mac and other Apple devices. Apple IDs contain the user's personal information and settings. When an Apple ID is used to log in to an Apple device, the device will automatic ...
and password combination, they cannot gain access to the account. It works by requiring not only the Apple ID and password, but also a verification code that is sent to an
iDevice or mobile phone number that is already known to be trusted.
If an unauthorized user attempts to sign in using another user's Apple ID, the owner of the Apple ID receives a notification that allows them to deny access to the unrecognized device.
Hardened memory allocation
iOS features a hardened
memory allocator
Memory management is a form of resource management applied to computer memory. The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when ...
known as
kalloc_type
that was introduced in
iOS 15. Since the
XNU kernel is primarily written in
memory unsafe languages such as
C and
C++,
kalloc_type
is designed to mitigate the large amount of
vulnerabilities
Vulnerability refers to "the quality or state of being exposed to the possibility of being attacked or harmed, either physically or emotionally."
A window of vulnerability (WOV) is a time frame within which defensive measures are diminished, com ...
that result from the use of these languages in the kernel. In order to achieve this,
kalloc_type
implements mitigations such as type isolation in order to prevent
type confusion and
buffer overflow
In information security and programming, a buffer overflow, or buffer overrun, is an anomaly whereby a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory locations.
Buffers are areas of memor ...
vulnerabilities. Ultimately, the prevention of
privilege escalation
Privilege escalation is the act of exploiting a bug, a design flaw, or a configuration oversight in an operating system or software application to gain elevated access to resources that are normally protected from an application or user. The re ...
is intended.
References
{{Reflist
IOS
iOS
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also include ...