Home Android Platform Security changes as from Android 5 – 11, With the key security measures added in each and the attacks that they were trying to prevent.
Post
Cancel

Android Platform Security changes as from Android 5 – 11, With the key security measures added in each and the attacks that they were trying to prevent.


Android 5.0*

  • Measure/Mitigation : Default Full Disk Encryption This Security change was introduced on devices that ship with Lollipop(Android 5.0) out of the box to improve protection of data on lost/ stolen devices.

  • Measure/Mitigation : Full Disk Encryption Improvement User password is protected against brute-force attacks using scrypt(a password-based key derivation function) Where available, the key is bound to the hardware keystore to prevent off-device attacks. The Android screen lock secret and the device encryption key are not sent off the device or exposed to any application.

  • Measure/Mitigation : Android sandbox reinforced with SELinux SELinux is a mandatory access control (MAC) system in the Linux kernel used to augment the existing discretionary access control (DAC) security model. This new layer provides additional protection against potential security vulnerabilities.

  • Measure/Mitigation : Smart Lock Introduction of trustlets that provide more flexibility for unlocking devices. The trustlets can allow devices to be unlocked automatically when close to another trusted device (via NFC, Bluetooth) or being used by someone with a trusted face.

  • Measure/Mitigation : Multi user, restricted profile, and guest modes for phones & tablets.

Android now provides for multiple users on phones and includes a guest mode that can be used to provide easy temporary access to your device without granting access to your data and apps.

  • Measure/Mitigation : Updates to WebView without OTA, WebView can now be updated independent of the framework and without a system OTA. This will allow for faster response to potential security issues in WebView.

  • Measure/Mitigation : Crypto Update,Updated cryptography for HTTPS and TLS/SSL. TLSv1.2 and TLSv1.1 is now enabled, Forward Secrecy is now preferred, AES-GCM is now enabled, and weak cipher suites (MD5, 3DES, and export cipher suites) are now disabled. See https://developer.android.com/reference/javax/net/ssl/SSLSocket.html for more details.

  • Measure/Mitigation: non-PIE linker support removal, Android now requires all dynamically linked executables to support PIE (position-independent executables). This enhances Android’s address space layout randomization (ASLR) implementation.

  • Measure/Mitigation : FORTIFY_SOURCE improved, The following libc functions now implement FORTIFY_SOURCE protections: stpcpy(), stpncpy(), read(), recvfrom(), FD_CLR(), FD_SET(), and FD_ISSET(). This provides protection against memory-corruption vulnerabilities involving those functions.

  • Measure/Mitigation : Security Fixes, Android 5.0 also includes fixes for Android-specific vulnerabilities. Information about these vulnerabilities has been provided to Open Handset Alliance members, and fixes are available in Android Open Source Project. To improve security, some devices with earlier versions of Android may also include these fixes

Android 6.0

  • Measure/Mitigation : Runtime Permissions Addition. Applications request permissions at runtime instead of being granted at App install time. Users can toggle permissions on and off for both M and pre-M applications.

  • Measure/Mitigation : Verified Boot. A set of cryptographic checks of system software are conducted prior to execution to ensure the phone is healthy from the bootloader all the way up to the operating system.

  • Measure/Mitigation : Hardware-Isolated Security. New Hardware Abstraction Layer (HAL) used by Fingerprint API, Lockscreen, Device Encryption, and Client Certificates to protect keys against kernel compromise and/or local physical attacks

  • Measure/Mitigation : Fingerprints. Devices can now be unlocked with just a touch. Developers can also take advantage of new APIs to use fingerprints to lock and unlock encryption keys.

  • Measure/Mitigation : SD Card Adoption. Removable media can be adopted to a device and expand available storage for app local data, photos, videos, etc., but still be protected by block-level encryption.

  • Measure/Mitigation : Clear Text Traffic Enhancement. Developers can use a new StrictMode to make sure their application doesn’t use cleartext.

  • Measure/Mitigation : System Hardening. Hardening of the system via policies enforced by SELinux. This offers better isolation between users, IOCTL filtering, reduce threat of exposed services, further tightening of SELinux domains, and extremely limited /proc access.

  • Measure/Mitigation : USB Access Control: Users must confirm to allow USB access to files, storage, or other functionality on the phone. Default is now charge only with access to storage requiring explicit approval from the user. an

Android 7.0

  • Measure/Mitigation : File-based encryption addition. Encrypting at the file level, instead of encrypting the entire storage area as a single unit, better isolates and protects individual users and profiles (such as personal and work) on a device.

  • Measure/Mitigation : Direct Boot. Enabled by file-based encryption, Direct Boot allows certain apps such as alarm clock and accessibility features to run when device is powered on but not unlocked.

  • Measure/Mitigation : Verified Boot. Verified Boot is now strictly enforced to prevent compromised devices from booting; it supports error correction to improve reliability against non-malicious data corruption.

  • Measure/Mitigation : SELinux Update. Updated SELinux configuration and increased seccomp coverage further locks down the application sandbox and reduces attack surface.

  • Measure/Mitigation : Library load-order randomization and improved ASLR. Increased randomness makes some code-reuse attacks less reliable.

Kernel hardening. Added additional memory protection for newer kernels by marking portions of kernel memory as read-only, restricting kernel access to userspace addresses and further reducing the existing attack surface.

  • Measure/Mitigation : APK signature scheme v2 introduction. Introduced a whole-file signature scheme that improves verification speed and strengthens integrity guarantees.

  • Measure/Mitigation : Trusted CA store. To make it easier for apps to control access to their secure network traffic, user-installed certificate authorities and those installed through Device Admin APIs are no longer trusted by default for apps targeting API Level 24+. Additionally, all new Android devices must ship with the same trusted CA store.

  • Measure/Mitigation : Network Security Config. Configure network security and TLS through a declarative configuration file.

Android 8.0

  • Measure/Mitigation : Encryption. Added support to evict key in work profile.

  • Measure/Mitigation : Verified Boot. Added Android Verified Boot (AVB). Verified Boot codebase supporting rollback protection for use in boot loaders added to AOSP. Recommend bootloader support for rollback protection for the HLOS. Recommend boot loaders can only be unlocked by user physically interacting with the device.

  • Measure/Mitigation : Lock screen. Added support for using tamper-resistant hardware to verify lock screen credential.

  • Measure/Mitigation : KeyStore. Required key attestation for all devices that ship with Android 8.0+. Added ID attestation support to improve Zero Touch Enrollment.

  • Measure/Mitigation : Sandboxing. More tightly sandboxed many components using Project Treble’s standard interface between framework and device-specific components. Applied seccomp filtering to all untrusted apps to reduce the kernel’s attack surface. WebView is now run in an isolated process with very limited access to the rest of the system.

  • Measure/Mitigation : Kernel hardening. Implemented hardened usercopy, PAN emulation, read-only after init, and KASLR.

  • Measure/Mitigation : Userspace hardening. Implemented CFI for the media stack. App overlays can no longer cover system-critical windows and users have a way to dismiss them. Streaming OS update. Enabled updates on devices that are are low on disk space.

  • Measure/Mitigation : Install unknown apps. Users must grant permission to install apps from a source that isn’t a first-party app store.

  • Measure/Mitigation : Privacy. Android ID (SSAID) has a different value for each app and each user on the device. For web browser apps, Widevine Client ID returns a different value for each app package name and web origin. net.hostname is now empty and the dhcp client no longer sends a hostname. android.os.Build.SERIAL has been replaced with the Build.SERIAL API which is protected behind a user-controlled permission. Improved MAC address randomization in some chipsets.

Android 9.0

  • Measure/Mitigation :Application signing The v3 APK signature scheme supports APK key rotation.

  • Measure/Mitigation :Biometric support Android 9 includes the public class BiometricPrompt, which apps can use to integrate biometric authentication support in a device- and modality-agnostic fashion. For more information about integrating your biometrics stack to include BiometricPrompt, see Biometrics.

  • Measure/Mitigation : Dynamic analysis Android 9 includes support for more exploit mitigation and analysis tools. ​
  • Measure/Mitigation : Control flow integrity (CFI) Control flow integrity (CFI) is a security mechanism that prohibits changes to the original control flow graph of a compiled binary, making it significantly harder to perform such attacks. ​
  • Measure/Mitigation : Kernel CFI In addition to system CFI, which is enabled by default, Android 9 and higher includes support for kernel control flow integrity (CFI).

  • Measure/Mitigation : Encryption ​ • File-based encryption (FBE) File-based encryption (FBE) is updated to work with adoptable storage. New devices should use file-based encryption instead of full-disk encryption. ​ • Metadata encryption Android 9 and higher includes support for metadata encryption where hardware support is present. With metadata encryption, a single key present at boot time uses file-based-encryption to encrypt any unenctypted content. ​ • Keystore Android 9 and higher includes Keymaster 4, which has these features. ​ • StrongBox Android 9 and higher includes support for Android Keystore keys that are stored and used in a physically separate CPU purpose-built for high-security applications, such as an embedded secure element (SE). StrongBox Keymaster is an implementation of the Keymaster HAL in discrete secure hardware. A StrongBox has: • Discrete CPU • Integral secure storage • High-quality true random number generator • Tamper-resistant packaging • Side-channel resistance

  • Measure/Mitigation : Secure key import To securely import a key into Keymaster 4, a key created off-device is encrypted with a specification of the authorizations that define how the key may be used.

  • Measure/Mitigation : 3DES support Keymaster 4 includes 3DES for compatibility with legacy systems that use 3DES.

  • Measure/Mitigation : Version binding To support Treble’s modular structure and break the binding of system.img to boot.img, Keymaster 4 changed the key version binding model to have separate patch levels for each partition. This allows each partition to be updated independently while still providing rollback protection.

  • Measure/Mitigation : Android Protected Confirmation API Supported devices that launch with Android 9 installed give developers the ability to use the Android Protected Confirmation API. With this API, apps can use an instance of ConfirmationPrompt to display a prompt to the user, asking them to approve a short statement. This statement allows an app to reaffirm that the user wants to complete a sensitive transaction, such as making a payment.

  • Measure/Mitigation : SELinux ​ • Per-app SELinux sandbox The application sandbox has new protections and test cases to ensure that all non-privileged apps tageting Android 9 and higher run individual SELinux sandboxes. ​ • Treble SELinux changes Updates to Treble SELinux in Android 9 and higher are documented in several pages in the SELinux section. ​ • Vendor init Vendor init closes the hole in the Treble system/vendor split by using a separate SELinux domain to run /vendor commands with vendor-specific permissions. ​ • System properties Android 9 restricts system properties from being shared between system and vendor partitions unnecessarily and provides a method for ensuring consistency between shared system properties. •​ SELinux attribute tests Android 9 includes new build-time tests that ensure all files in specific locations have the appropriate attributes. For example, all files in sysfs have the required sysfs_type attribute.

Android 10.0

  • Measure/Mitigation : BoundsSanitizer Android 10 deploys BoundsSanitizer (BoundSan) in Bluetooth and codecs. BoundSan uses UBSan’s bounds sanitizer. This mitigation is enabled on a per-module level. It helps keep critical components of Android secure and shouldn’t be disabled. BoundSan is enabled in the following codecs:

libFLAC libavcdec libavcenc libhevcdec libmpeg2 libopus libvpx libspeexresampler libvorbisidec libaac libxaac

  • Measure/Mitigation : Execute-only memory By default, executable code sections for AArch64 system binaries are marked execute-only (nonreadable) as a hardening mitigation against just-in-time code reuse attacks. Code that mixes data and code together and code that purposefully inspects these sections (without first remapping the memory segments as readable) no longer functions. Apps with a target SDK of Android 10 (API level 29 or higher) are impacted if the app attempts to read code sections of execute-only memory (XOM) enabled system libraries in memory without first marking the section as readable.

  • Measure/Mitigation : Extended access Trust agents, the underlying mechanism used by tertiary authentication mechanisms such as Smart Lock, can only extend unlock in Android 10. Trust agents can no longer unlock a locked device and can only keep a device unlocked for a maximum of four hours.

  • Measure/Mitigation : Face authentication Face authentication allows users to unlock their device simply by looking at the front of their device. Android 10 adds support for a new face authentication stack that can securely process camera frames, preserving security and privacy during face authentication on supported hardware. Android 10 also provides an easy way for security-compliant implementations to enable app integration for transactions such as online banking or other services.

  • Measure/Mitigation : Integer Overflow Sanitization Android 10 enables Integer Overflow Sanitization (IntSan) in software codecs. Ensure that playback performance is acceptable for any codecs that aren’t supported in the device’s hardware. IntSan is enabled in the following codecs:

libFLAC libavcdec libavcenc libhevcdec libmpeg2 libopus libvpx libspeexresampler libvorbisidec

  • Measure/Mitigation : Modular system components Android 10 modularizes some Android system components and enables them to be updated outside of the normal Android release cycle. Some modules include:

Android Runtime Conscrypt DNS Resolver DocumentsUI ExtServices Media ModuleMetadata Networking PermissionController Time Zone Data OEMCrypto Android 10 uses OEMCrypto API version 15.

  • Measure/Mitigation : Scudo Scudo is a dynamic user-mode memory allocator designed to be more resilient against heap-related vulnerabilities. It provides the standard C allocation and deallocation primitives, as well as the C++ primitives.

  • Measure/Mitigation : ShadowCallStack ShadowCallStack (SCS) is an LLVM instrumentation mode that protects against return address overwrites (like stack buffer overflows) by saving a function’s return address to a separately allocated ShadowCallStack instance in the function prolog of nonleaf functions and loading the return address from the ShadowCallStack instance in the function epilog.

  • Measure/Mitigation : WPA3 and Wi-Fi Enhanced Open Android 10 adds support for the Wi-Fi Protected Access 3 (WPA3) and Wi-Fi Enhanced Open security standards to provide better privacy and robustness against known attacks.

  • Measure/Mitigation : Privacy App access when targeting Android 9 or lower If your app runs on Android 10 or higher but targets Android 9 (API level 28) or lower, the platform applies the following behavior:

If your app declares a element for either ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION, the system automatically adds a element for ACCESS_BACKGROUND_LOCATION during installation. If your app requests either ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION, the system automatically adds ACCESS_BACKGROUND_LOCATION to the request.

  • Measure/Mitigation : Background activity restrictions Starting in Android 10, the system places restrictions on starting activities from the background. This behavior change helps minimize interruptions for the user and keeps the user more in control of what’s shown on their screen. As long as your app starts activities as a direct result of user interaction, your app most likely isn’t affected by these restrictions. To learn more about the recommended alternative to starting activities from the background, see the guide on how to alert users of time-sensitive events in your app.

  • Measure/Mitigation : Camera metadata Android 10 changes the breadth of information that the getCameraCharacteristics() method returns by default. In particular, your app must have the CAMERA permission in order to access potentially device-specific metadata that is included in this method’s return value. To learn more about these changes, see the section about camera fields that require permission.

  • Measure/Mitigation : Clipboard data Unless your app is the default input method editor (IME) or is the app that currently has focus, your app cannot access clipboard data on Android 10 or higher.

  • Measure/Mitigation : Device location To support the additional control that users have over an app’s access to location information, Android 10 introduces the ACCESS_BACKGROUND_LOCATION permission. Unlike the ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions, the ACCESS_BACKGROUND_LOCATION permission only affects an app’s access to location when it runs in the background. An app is considered to be accessing location in the background unless one of the following conditions is satisfied:

An activity belonging to the app is visible. The app is running a foreground service that has declared a foreground service type of location. To declare the foreground service type for a service in your app, set your app’s targetSdkVersion or compileSdkVersion to 29 or higher. Learn more about how foreground services can continue user-initiated actions that require access to location.

  • Measure/Mitigation : External storage By default, apps targeting Android 10 and higher are given scoped access into external storage, or scoped storage. Such apps can see the following types of files within an external storage device without needing to request any storage-related user permissions:

Files in the app-specific directory, accessed using getExternalFilesDir(). Photos, videos, and audio clips that the app created from the media store. To learn more about scoped storage, as well as how to share, access, and modify files that are saved on external storage devices, see the guides on how to manage files in external storage and access and modify media files.

  • Measure/Mitigation : MAC address randomization On devices that run Android 10 or higher, the system transmits randomized MAC addresses by default. If your app handles an enterprise use case, the platform provides APIs for several operations related to MAC addresses:

Obtain randomized MAC address: Device owner apps and profile owner apps can retrieve the randomized MAC address assigned to a specific network by calling getRandomizedMacAddress(). Obtain actual, factory MAC address: Device owner apps can retrieve a device’s actual hardware MAC address by calling getWifiMacAddress(). This method is useful for tracking fleets of devices. Non-resettable device identifiers Starting in Android 10, apps must have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access the device’s non-resettable identifiers, which include both IMEI and serial number.

  • Measure/Mitigation : Third-party apps installed from the Google Play Store cannot declare privileged permissions. Affected methods include the following: Build getSerial() TelephonyManager getImei() getDeviceId() getMeid() getSimSerialNumber() getSubscriberId() If your app doesn’t have the permission and you try asking for information about non-resettable identifiers anyway, the platform’s response varies based on target SDK version:

If your app targets Android 10 or higher, a SecurityException occurs. If your app targets Android 9 (API level 28) or lower, the method returns null or placeholder data if the app has the READ_PHONE_STATE permission. Otherwise, a SecurityException occurs. Physical activity recognition Android 10 introduces the android.permission.ACTIVITY_RECOGNITION runtime permission for apps that need to detect the user’s step count or classify the user’s physical activity, such as walking, biking, or moving in a vehicle. This is designed to give users visibility of how device sensor data is used in Settings. Some libraries within Google Play services, such as the Activity Recognition API and the Google Fit API, don’t provide results unless the user has granted your app this permission. The only built-in sensors on the device that require you to declare this permission are the step counter and step detector sensors. If your app targets Android 9 (API level 28) or lower, the system auto-grants the android.permission.ACTIVITY_RECOGNITION permission to your app, as needed, if your app satisfies each of the following conditions:

The manifest file includes the com.google.android.gms.permission.ACTIVITY_RECOGNITION permission. The manifest file doesn’t include the android.permission.ACTIVITY_RECOGNITION permission. If the system-auto grants the android.permission.ACTIVITY_RECOGNITION permission, your app retains the permission after you update your app to target Android 10. However, the user can revoke this permission at any time in system settings.

  • Measure/Mitigation : /proc/net filesystem restrictions On devices that run Android 10 or higher, apps cannot access /proc/net, which includes information about a device’s network state. Apps that need access to this information, such as VPNs, should use the NetworkStatsManager or ConnectivityManager class.

  • Measure/Mitigation : Permission groups removed from UI As of Android 10, apps cannot look up how permissions are grouped in the UI.

  • Measure/Mitigation : Removal of contacts affinity Starting in Android 10, the platform doesn’t keep track of contacts affinity information. As a result, if your app conducts a search on the user’s contacts, the results aren’t ordered by frequency of interaction. The guide about ContactsProvider contains a notice describing the specific fields and methods that are obsolete on all devices starting in Android 10.

  • Measure/Mitigation : Restricted access to screen contents To protect users’ screen contents, Android 10 prevents silent access to the device’s screen contents by changing the scope of the READ_FRAME_BUFFER, CAPTURE_VIDEO_OUTPUT, and CAPTURE_SECURE_VIDEO_OUTPUT permissions. As of Android 10, these permissions are signature-access only. Apps that need to access the device’s screen contents should use the MediaProjection API, which displays a prompt asking the user to provide consent.

  • Measure/Mitigation : USB device serial number If your app targets Android 10 or higher, your app cannot read the serial number until the user has granted your app permission to access the USB device or accessory. To learn more about working with USB devices, see the guide on how to configure USB hosts.

  • Measure/Mitigation : Wi-Fi Apps targeting Android 10 or higher cannot enable or disable Wi-Fi. The WifiManager.setWifiEnabled() method always returns false. If you need to prompt users to enable and disable Wi-Fi, use a settings panel.

  • Measure/Mitigation : Restrictions on direct access to configured Wi-Fi networks To protect user privacy, manual configuration of the list of Wi-Fi networks is restricted to system apps and device policy controllers (DPCs). A given DPC can be either the device owner or the profile owner. If your app targets Android 10 or higher, and it isn’t a system app or a DPC, then the following methods don’t return useful data:

  • Measure/Mitigation : The getConfiguredNetworks() method always returns an empty list. Each network operation method that returns an integer value—addNetwork() and updateNetwork()—always returns -1. Each network operation that returns a boolean value—removeNetwork(), reassociate(), enableNetwork(), disableNetwork(), reconnect(), and disconnect()—always returns false.

This post is licensed under CC BY 4.0 by the author.

-

ASPIRE CTF 2021 — Mobile Security CTF

Comments powered by Disqus.