Mobile OS Flashcards
Let's face the new challenges in palms
In the Android OS architecture, which layer do user applications reside in?
a) Kernel Space
b) User Space
c) Middleware Layer
d) Hardware Platform
Answer: b) User Space
Explanation:
User applications, including both default and third-party apps, operate in the User Space of the Android OS architecture.
What is the primary function of sandboxing in mobile OS security?
a) To speed up application performance
b) To allow apps to access all system resources
c) To isolate applications and limit their access to system resources
d) To provide a user interface for the OS
Answer: c) To isolate applications and limit their access to system resources
Explanation:
Sandboxing is a security mechanism that isolates applications, restricting their access to system resources to prevent malicious actions.
Android applications can be written in:
a) Only Java
b) Java and C++
c) Only C++
d) Assembly language
Answer: b) Java and C++
Explanation:
While Android apps are primarily written in Java, developers can also include native code using C++ via the Java Native Interface (JNI).
Which component of the Android middleware layer is responsible for starting applications?
a) Package Manager
b) Activity Manager
c) Android Runtime
d) Native Libraries
Answer: b) Activity Manager
Explanation:
The Activity Manager is responsible for starting and managing applications within the Android OS.
What is a UID in the context of Android app sandboxing?
a) User Interface Design
b) Unique Identifier
c) Universal Input Device
d) Unit of Instruction
Answer: b) Unique Identifier
Explanation:
Android assigns a Unique Identifier (UID) to each app, which is used to enforce sandboxing at the process level.
Which layer of the Android software stack contains the Dalvik Virtual Machine (DVM)?
a) Application Layer
b) Middleware Layer
c) Kernel Layer
d) Hardware Platform
Answer: b) Middleware Layer
Explanation:
The Dalvik Virtual Machine is a key component of the Android Runtime, which is part of the Middleware Layer.
What is the file format that the Dalvik Virtual Machine (DVM) runs?
a) .exe
b) .apk
c) .dex
d) .jar
Answer: c) .dex
Explanation:
The DVM executes files in the “.dex” format, which is optimized for embedded environments.
What does the Android Reference Monitor mediate access to?
a) CPU and RAM
b) User applications
c) Critical services like SMS and Contacts
d) Network drivers
Answer: c) Critical services like SMS and Contacts
Explanation:
The Reference Monitor in the Application Framework mediates access requests to critical services based on permissions.
In Android, each application is isolated in its own:
a) Kernel
b) Virtual Machine
c) Sandbox
d) Activity
Answer: c) Sandbox
Explanation:
Android employs sandboxing to isolate applications from each other and the system.
At what level is sandboxing enforced in Android?
a) Application Layer
b) Middleware Layer
c) Linux Kernel Level
d) Hardware Level
Answer: c) Linux Kernel Level
Explanation: Sandboxing in Android is enforced by the underlying Linux kernel.
What is the purpose of assigning a unique User ID (UID) to each Android app?
a) To identify the app developer
b) To manage app installations
c) To isolate app processes
d) To optimize app performance
Answer: c) To isolate app processes
Explanation:
UIDs are used to isolate app processes from each other, enhancing security.
Where is each Android app’s private data directory located?
a) In the root directory
b) In a shared public directory
c) In its own dedicated data directory
d) In the Dalvik VM
Answer: c) In its own dedicated data directory
Explanation:
Each app has its own private data directory to store its data, as part of the filesystem-level sandboxing.
What type of attack occurs when an application with fewer permissions gains unauthorized access to components of a more privileged application?
a) Denial of Service attack
b) Buffer Overflow attack
c) Privilege Escalation attack
d) Man-in-the-Middle attack
Answer: c) Privilege Escalation attack
Explanation:
A privilege escalation attack involves an app gaining more permissions than it should have, allowing it to access sensitive resources.
Which of the following is NOT a component of an Android application?
a) Activities
b) Services
c) Intents
d) Broadcast receivers
Answer: c) Intents
Explanation:
Activities, services, broadcast receivers, and content providers are the four main components.
Intents are used to communicate between these components.
What does the Package Manager in Android’s Application Framework handle?
a) Starting applications
b) Installing and managing permissions and applications
c) Running virtual machines
d) Managing network connections
Answer: b) Installing and managing permissions and applications
Explanation:
The Package Manager is responsible for the installation, management, and permissions of applications.
Which of the following is a key aspect of Android’s security framework?
a) Lack of application isolation
b) Discretionary Access Control (DAC) to the file system
c) No code signing
d) Open access to all system resources
Answer: b) Discretionary Access Control (DAC) to the file system
Explanation:
Android’s security framework includes application isolation, a permission framework, and DAC to the file system.
How does Android ensure code integrity?
a) By relying on user verification
b) By signing system code with Google’s key and applications with developer keys
c) By having no code signing process
d) By using hardware-based security
Answer: b) By signing system code with Google’s key and applications with developer keys
Explanation:
Android ensures code integrity by requiring system code to be signed by Google and applications to be signed by developers.
What is the purpose of the Dalvik Virtual Machine (DVM) in Android?
a) To manage hardware resources
b) To run applications
c) To handle network connections
d) To manage file systems
Answer: b) To run applications
Explanation:
The DVM is a virtual machine optimized for mobile devices that executes Android applications.
Which of the following is true about Android application sandboxing?
a) It allows any app to access any resource.
b) It is primarily enforced at the application layer.
c) It restricts apps to their own resources and permissions.
d) It is not applied to native applications.
Answer: c) It restricts apps to their own resources and permissions.
Explanation:
Android sandboxing limits apps to their own resources and the permissions granted to them.
Question: What is the role of the Linux kernel in Android’s security model?
a) To manage user interface
b) To enforce sandboxing
c) To run the Dalvik VM
d) To handle application installation
Answer: b) To enforce sandboxing
Explanation:
The Linux kernel is responsible for enforcing the sandboxing of Android applications.
Name the two primary levels at which Android enforces sandboxing.
Process level and filesystem level
What is the purpose of assigning a Unique ID (UID) to each Android application?
To run each app as a separate process and isolate it from other apps.
What is the Dalvik Virtual Machine (DVM), and what type of files does it execute?
A virtual machine optimized for embedded environments that executes .dex files.
What are the four main components of an Android application?
Activities,
Services,
Broadcast Receivers,
and Content Providers.
Briefly describe the function of the Android Activity Manager.
Responsible for starting and managing applications.
What is the role of the Package Manager in the Android OS?
Installation of new applications and management of permissions and applications.
Explain the concept of “sandboxing” in mobile OS security.
A security mechanism that isolates applications and restricts their access to system resources.
How does Android’s permission framework contribute to application access control?
It mediates access requests to critical services based on permissions.
What security measure does Android use to ensure code integrity for system code and applications?
System code is signed by Google, and applications are signed by developers.
What is a “privilege escalation attack” in the context of Android security?
An attack where an application with fewer permissions gains unauthorized access to components of a more privileged application.
Name two types of vulnerabilities related with operating systems.
Buffer overflows, race conditions, denial of service (DoS), rootkit attacks, privilege escalation, memory over-reads, pointer manipulation, time manipulation, directory manipulation or deletion, etc.
What is the primary function of the Android Runtime?
To run Android applications using the Dalvik Virtual Machine and core libraries.
Describe the two levels of sandboxing implemented in Android.
Process level (each app in a dedicated process with a UID) and filesystem level (each app has a private data directory).
What is the purpose of having a private data folder for each Android application?
To restrict access, so only the application itself can read and write to its own data.
How does Android isolate applications from each other?
By assigning each application a unique User ID (UID) and running them in separate processes.
What are native libraries in the Android architecture, and how are they accessed?
C/C++ system libraries, exposed to developers via the Android application framework.
What is the role of Content Providers in Android applications?
To manage and share data between applications, similar to an SQL-like database.
Explain the concept of Application Isolation in Android.
Each application is isolated in its own sandbox, and can only access its own resources.
What is the middleware layer in the Android architecture responsible for?
Providing services and APIs that applications can use, including the Android Runtime and Native Libraries.
What is the potential consequence of a permission escalation attack?
An application with fewer permissions can gain unauthorized access to components of a more privileged application.
Describe the Android OS architecture, explaining the roles of the key layers (Kernel Layer, Middleware Layer, Application Layer) and their components.
How does this architecture contribute to the overall security of the Android system?
- The Android OS architecture is divided into several layers:
(1) Kernel Layer:
Based on the Linux kernel, this layer provides core OS functionalities like memory management, process management, and device drivers.
It is crucial for security as it enforces sandboxing.
(2) Middleware Layer:
This layer provides services and APIs that applications can use.
It includes the Android Runtime (with the Dalvik VM and Core Libraries) and Native Libraries.
The Android Runtime is responsible for executing applications, and the Native Libraries provide C/C++ functionality.
(3) Application Layer:
This layer contains user applications, both default and third-party.
Applications are executed within their own Dalvik VM instances. - This architecture contributes to security by:
(1) Sandboxing:
Isolating applications from each other and the system.
(2) Permission Control:
Managing access to sensitive resources through a permission framework.
(3) Code Integrity:
Ensuring the integrity of the OS and applications through signing.
Explain the concept of sandboxing in Android.
How is it implemented at the process level and the filesystem level, and what security benefits does it provide?
Sandboxing is a security mechanism that isolates applications, restricting their access to system resources to prevent malicious actions.
- Process Level:
Each application is assigned a unique User ID (UID) and runs in a separate process.
This prevents applications from directly interfering with each other’s memory or processes. - Filesystem Level:
Each application has its own private data directory, and only that application has permission to read and write to that directory.
This prevents applications from accessing or modifying each other’s data. - Security Benefits:
(1) Isolation:
Prevents malicious apps from accessing sensitive data or interfering with other apps.
(2) Containment:
Limits the damage a compromised app can cause, as its access is restricted to its sandbox.
(3) Stability:
Improves system stability by preventing one app from crashing others or the OS.
Describe the Android security framework.
What are its key components, and how do they work together to protect the Android OS and applications?
- The Android security framework is designed to protect the OS and applications from various threats.
Its key components include:
(1) Application Isolation:
Each application runs in its own sandbox, preventing it from accessing other applications’ data or interfering with the system.
(2) Permission Framework:
This framework controls access to sensitive resources (e.g., camera, location, contacts) by requiring applications to declare permissions and users to grant or deny those permissions.
(3) Discretionary Access Control (DAC):
At the Linux kernel level, DAC controls access to files and directories, further enforcing application isolation.
(4) Code Integrity:
System code is signed by Google, and applications are signed by developers, ensuring that code has not been tampered with. - These components work together to provide a layered security approach:
(1) Application isolation and DAC prevent applications from accessing unauthorized resources.
(2) The permission framework allows users to control what resources applications can access.
(3) Code signing ensures that the code is from a trusted source and has not been modified.
Explain the role of the Dalvik Virtual Machine (DVM) in the Android OS.
How does it contribute to application security and performance?
The Dalvik Virtual Machine (DVM) is a key component of the Android Runtime.
It is responsible for executing Android applications.
- Role:
(1) DVM executes applications in a sandboxed environment, providing a layer of isolation between applications and the system.
(2) It runs optimized “.dex” files, which are converted from Java “.class” files. - Contribution to Security:
The DVM’s sandboxing helps prevent malicious applications from gaining unauthorized access to system resources. - Contribution to Performance:
The .dex format and DVM are optimized for mobile devices, improving application startup time and memory usage.
Discuss the concept of “Application Isolation” in Android.
Why is it important, and how is it achieved?
Application isolation is a fundamental security principle in Android, where each application is isolated in its own sandbox.
- Importance:
(1) It prevents applications from interfering with each other.
(2) It limits the damage that a malicious application can cause.
(3) It protects user data from unauthorized access. - Achievement:
(1) Process Isolation:
Each application runs in a separate process with a unique User ID (UID).
The OS enforces process boundaries, preventing one process from accessing the memory space of another.
(2) Filesystem Isolation:
Each application has its own private data directory, and access to this directory is restricted to the application itself.
What is a “permission escalation attack” in Android?
Explain how it can occur and what security implications it has.
A permission escalation attack occurs when an application with fewer permissions gains unauthorized access to components or resources of a more privileged application.
- How it can occur:
(1) Vulnerabilities in system services or other applications can be exploited to bypass the permission framework.
(2) Malicious applications may attempt to trick users into granting excessive permissions. - Security implications:
(1) An attacker can gain access to sensitive data, such as contacts, SMS messages, or location information.
(2) An attacker can perform actions that they are not authorized to do, such as sending SMS messages, making phone calls, or installing applications.
(3) It can compromise the integrity of the entire system.
Describe the two levels of sandboxing in Android: process-level and filesystem-level.
Explain how each level contributes to overall application security.
Android employs two levels of sandboxing to isolate applications:
- Process-Level Sandboxing:
(1) Each application is assigned a unique User ID (UID) and runs in a separate process.
(2) The Linux kernel enforces process isolation, preventing applications from directly accessing each other’s memory or resources.
(3) This level of sandboxing prevents one application from crashing or corrupting another application’s execution. - Filesystem-Level Sandboxing:
(1) Each application has its own dedicated data directory.
(2) Only the application itself has permission to read and write to this directory.
(3) This level of sandboxing prevents applications from accessing or modifying each other’s data files.
Contribution to overall security:
1. Process-level sandboxing enhances system stability and prevents applications from interfering with each other’s execution.
- Filesystem-level sandboxing protects application data and prevents unauthorized access to sensitive information.
Explain the concept of User Space and Kernel Space in an operating system.
How does this separation contribute to the security of a mobile OS like Android?
- Operating systems typically divide memory and execution into two main spaces:
(1) User Space:
This is where user applications and most system programs run.
Code in User Space has limited access to system resources and must use system calls to request services from the kernel.
(2) Kernel Space:
This is where the OS kernel runs.
The kernel has direct access to all hardware and system resources. - Contribution to Android security:
(1) Separating User Space and Kernel Space provides a fundamental security boundary.
(2) If an application in User Space is compromised, the damage is limited because it cannot directly access kernel functions or hardware.
(3) The kernel can enforce security policies and control access to resources, ensuring that applications cannot bypass security mechanisms.
Describe the main components of the Middleware Layer in the Android OS architecture.
What role does each component play in the functionality and security of the system?
The Middleware Layer in Android provides services and APIs that applications can use. It includes:
- Android Runtime:
(1) Contains the Dalvik Virtual Machine (DVM), which executes applications.
(2) Provides Core Libraries, which offer Java APIs for applications.
(3) Role: Executes applications in a sandboxed environment and provides essential Java functionalities. - Native Libraries:
(1) Contains C/C++ system libraries (e.g., Libc, media libraries).
(2) Role: Provides native functionalities that can be accessed by applications through the Android Application Framework. - Application Framework:
(1) Provides APIs for basic functionalities and services (e.g., location, telephony).
(2) Includes components like the Activity Manager (manages applications), Package Manager (installs and manages applications), and Reference Monitor (mediates access to sensitive services).
(3) Role: Provides a high-level API for application developers and enforces security policies through the Reference Monitor.
Role in functionality and security:
The Middleware Layer provides essential services and APIs for applications while also enforcing security policies and isolating applications from the underlying system.
Discuss the security implications of Android applications using native code (C/C++).
What are the potential risks, and what security measures should be taken?
Android applications can use native code (C/C++) via the Java Native Interface (JNI).
- Potential risks:
(1) Memory corruption:
Native code is more susceptible to memory corruption vulnerabilities (e.g., buffer overflows) than Java code.
(2) Security vulnerabilities:
Vulnerabilities in native libraries can be exploited by malicious applications.
(3) Bypassing sandboxing:
While native code is still subject to sandboxing, vulnerabilities can potentially be exploited to bypass security restrictions.
(4) Increased complexity:
Managing native code adds complexity to application development and increases the risk of security flaws. - Security measures:
(1) Secure coding practices:
Developers should follow secure coding practices to minimize vulnerabilities in native code.
(2) Code reviews:
Thorough code reviews should be conducted to identify potential security flaws.
(3) Static and dynamic analysis:
Use static and dynamic analysis tools to detect vulnerabilities in native code.
(4) Regular updates:
Keep native libraries up to date with the latest security patches.
(5) Minimize native code:
Use native code only when necessary and minimize its complexity.
Explain the concept of the Android Runtime and its components: Dalvik Virtual Machine (DVM) and Core Libraries.
Discuss their roles in executing Android applications.
The Android Runtime is a crucial part of the Middleware Layer, responsible for executing Android applications.
- Dalvik Virtual Machine (DVM):
(1) A virtual machine optimized for embedded environments like mobile devices.
(2) Executes applications in the form of “.dex” files, which are optimized versions of Java bytecode.
(3) Relies on the Linux kernel for threading and low-level memory management. - Core Libraries:
(1) Provide most of the functionality available in the core libraries of Java.
(2) Offer core APIs that applications can use. - Roles in executing applications:
(1) The DVM provides the environment in which Android applications run, ensuring isolation and managing resources.
(2) The Core Libraries provide the necessary APIs and functionalities that applications need to interact with the system.
Describe the components of an Android application.
How do these components contribute to the overall functionality of an Android app?
- Android applications consist of the following main components:
(1) Activities:
Represent user interfaces for interacting with the application.
(2) Services:
Run in the background to perform long-running operations or tasks without user interaction.
(3) Broadcast Receivers:
Respond to system-wide broadcast announcements (e.g., when the battery is low).
(4) Content Providers:
Manage and share data between applications (similar to a database). - Contribution to functionality:
(1) Activities handle user interaction.
(2) Services perform background tasks.
(3) Broadcast receivers enable communication with the system.
(4) Content providers facilitate data sharing.
Explain how Android manages application permissions.
What is the role of the Reference Monitor in this process, and why is it important for security?
- Android manages application permissions through a permission framework in the Middleware Layer.
- Applications must declare the permissions they need (e.g., access to location, camera, internet) in their manifest file.
- The system then prompts the user to grant or deny these permissions.
- Reference Monitor:
(1) A component within the Application Framework that mediates access requests to critical services.
(2) It checks whether an application has the necessary permissions before allowing it to access a protected resource or service. - Importance for security:
(1) The permission framework and Reference Monitor enforce fine-grained access control, preventing applications from accessing sensitive resources without user authorization.
(2) This helps to protect user privacy and prevent malicious applications from abusing system resources.
Discuss the mechanisms Android employs to ensure code integrity.
Why is code integrity important for mobile OS security?
- Android employs code signing to ensure code integrity:
(1) System code is signed by Google.
(2) Applications are signed by developers using a developer key. - Importance of code integrity:
(1) Authentication:
Code signing verifies the origin of the code, ensuring that it comes from a trusted source.
(2) Tamper detection:
It detects any unauthorized modifications to the code, ensuring that it has not been tampered with.
(3) Trust establishment:
Code signing helps establish trust in the system and applications, assuring users that the code they are running is safe.
Describe the process-level sandboxing in Android.
How does assigning a unique User ID (UID) to each application contribute to security?
- In process-level sandboxing, Android assigns a unique User ID (UID) to each application during installation.
- Each application runs in a separate process with its own UID.
- The Linux kernel enforces process isolation, preventing processes from accessing each other’s memory space and resources.
- Contribution of UID to security:
(1) Isolation:
UIDs provide a strong form of isolation, ensuring that one application cannot directly interfere with or access the data of another application.
(2) Least privilege:
The kernel can use UIDs to enforce the principle of least privilege, granting each application only the necessary permissions.
(3) Resource management:
UIDs help the kernel manage resources effectively and prevent one application from consuming excessive resources.
Describe the filesystem-level sandboxing in Android.
How does having a private data directory for each application contribute to security?
- In filesystem-level sandboxing, each Android application is assigned a dedicated private data directory.
- By default, only the application itself has permission to read and write to this directory.
- This directory is where the application stores its data, such as files, databases, and shared preferences.
- Contribution to security:
(1) Data isolation:
It prevents applications from accessing or modifying each other’s data, protecting sensitive user information and application-specific files.
(2) Integrity protection:
It helps maintain the integrity of application data, as other applications cannot tamper with it.
(3) Reduced attack surface:
It limits the potential damage if one application is compromised, as the attacker’s access is restricted to that application’s data directory.
Explain the concept of a “permission escalation attack” in Android.
What vulnerabilities can make Android systems susceptible to such attacks?
- A permission escalation attack occurs when an application with fewer permissions gains unauthorized access to components or resources of a more privileged application.
- This means a malicious app could bypass the intended security restrictions and access sensitive data or perform privileged actions.
- Vulnerabilities that can make Android systems susceptible:
(1) Vulnerabilities in the Android OS itself (e.g., in the kernel or system services).
(2) Vulnerabilities in other installed applications.
(3) Improper handling of permissions or intents by applications.
Discuss the security considerations for applications that include native code (C/C++) in Android.
What are the potential risks and best practices to mitigate them?
Android allows applications to include native code (C/C++) for performance-critical tasks using the Java Native Interface (JNI).
- Potential risks:
(1) Memory management issues:
Native code is more prone to memory management errors (e.g., buffer overflows, memory leaks), which can lead to vulnerabilities.
(2) Direct access to resources:
Native code can potentially bypass some of the security restrictions of the Android Runtime, if not handled carefully.
(3) Increased complexity:
Debugging and securing native code is generally more complex than Java code. - Best practices to mitigate risks:
(1) Secure coding practices:
Employ secure coding techniques to prevent memory corruption and other vulnerabilities.
(2) Careful input validation:
Validate all input from Java to native code to prevent attacks like buffer overflows.
(3) Minimize JNI usage:
Use native code only when necessary and keep the JNI interface as small as possible.
(4) Regular security audits:
Conduct security audits and code reviews of native code.
Describe the Android application sandboxing mechanism.
How does it protect applications and the system from malicious or faulty applications?
Android uses sandboxing to isolate applications from each other and the system.
This means each application runs in a restricted environment with limited access to resources.
- Protection mechanisms:
(1) Process-level sandboxing:
Each app runs in a separate process with a unique User ID (UID), preventing memory interference.
(2) Filesystem-level sandboxing:
Each app has a private data directory, restricting access to its data.
(3) Permissions:
Apps must declare and request permissions to access sensitive resources, and users grant or deny these permissions. - How it protects:
(1) Isolation:
Sandboxing prevents a malicious app from accessing other apps’ data or interfering with their operation.
(2) Resource control:
It limits the amount of resources a faulty app can consume, preventing it from crashing the system.
(3) Privilege limitation:
It restricts the actions a malicious app can perform, even if it exploits a vulnerability.
Discuss the evolution of mobile OS security with a focus on sandboxing.
How have sandboxing techniques improved over time to address emerging threats in mobile environments?
Mobile OS security, particularly sandboxing, has evolved significantly to address the increasing sophistication of mobile threats.
- Early stages:
Early mobile OSes had limited or weak sandboxing, leading to vulnerabilities and greater risks from malicious apps. - Improvements in sandboxing:
(1) Process isolation:
Modern mobile OSes like Android and iOS enforce strong process isolation, where each app runs in its own protected memory space.
(2) Filesystem sandboxing:
Restricting app access to specific directories and files, preventing unauthorized data access.
(3) Capabilities and permissions:
Fine-grained control over what system resources an app can access, requiring explicit user consent.
(4) Virtualization and containerization:
More advanced techniques to further isolate apps and system components. - Addressing emerging threats:
(1) Sandboxing has become more robust to counter threats like privilege escalation, malware injection, and data exfiltration.
(2) Mobile OSes are continuously incorporating new security features to adapt to evolving attack vectors.