安全增強

Android 不斷改進其安全能力和產品。請參閱左側導覽中按版本列出的增強功能清單。

安卓14

每個 Android 版本都包含數十項安全增強功能來保護使用者。以下是 Android 14 中提供的一些主要安全增強功能:

  • Android 10 中引入的硬體輔助 AddressSanitizer (HWASan) 是一種類似AddressSanitizer 的記憶體錯誤偵測工具。 Android 14 為 HWASan 帶來了重大改進。了解它如何幫助防止 bug 進入 Android 版本, HWAddressSanitizer
  • 在Android 14 中,從與第三方共享位置數據的應用程式開始,系統運行時權限對話框現在包含一個可點擊的部分,突出顯示應用程式的數據共享實踐,包括應用程式為何決定與第三方共享數據等資訊。
  • Android 12 引入了在調變解調器層級停用 2G 支援的選項,這可以保護使用者免受 2G 過時安全模型帶來的固有安全風險。認識到禁用 2G 對企業客戶的重要性,Android 14 在 Android Enterprise 中啟用了此安全功能,引入了對 IT 管理員的支持,以限制託管設備降級到 2G 連接的能力。
  • 增加了對拒絕空加密蜂窩連接的支持,確保電路交換語音和 SMS 流量始終加密並免受被動無線攔截。詳細了解 Android 強化蜂巢連線的計畫
  • 新增了對多個 IMEI 的支持
  • 自 Android 14 起,AES-HCTR2 成為具有加速加密指令的裝置的首選檔案名稱加密模式。
  • 蜂巢連接
  • 為 Android安全中心新增了文檔
  • 如果您的應用程式面向 Android 14 並使用動態程式碼載入 (DCL),則所有動態載入的檔案都必須標記為唯讀。否則,系統會拋出異常。我們建議應用程式盡可能避免動態載入程式碼,因為這樣做會大大增加應用程式因程式碼注入或程式碼篡改而受到損害的風險。

查看我們完整的 AOSP發行說明以及 Android 開發人員功能和變更清單

安卓13

Every Android release includes dozens of security enhancements to protect users. Here are some of the major security enhancements available in Android 13:

  • Android 13 adds multi-document presentation support. This new Presentation Session interface enables an application to do a multi-document presentation, something which isn't possible with the existing API. For further information, refer to Identity Credential
  • In Android 13, intents originating from external apps are delivered to an exported component if and only if the intents match their declared intent-filter elements.
  • Open Mobile API (OMAPI) is a standard API used to communicate with a device's Secure Element. Before Android 13, only applications and framework modules had access to this interface. By converting it to a vendor stable interface, HAL modules are also capable of communicating with the secure elements through the OMAPI service. For more information, see OMAPI Vendor Stable Interface.
  • As of Android 13-QPR, shared UIDs are deprecated. Users of Android 13 or higher should put the line `android:sharedUserMaxSdkVersion="32"` in their manifest. This entry prevents new users from getting a shared UID. For further information on UIDs, see Application signing.
  • Android 13 added support Keystore symmetric cryptographic primitives such as AES (Advanced Encryption Standard), HMAC (Keyed-Hash Message Authentication Code), and asymmetric cryptographic algorithms (including Elliptic Curve, RSA2048, RSA4096, and Curve 25519)
  • Android 13 (API level 33) and higher supports a runtime permission for sending non-exempt notifications from an app. This gives users control over which permission notifications they see.
  • Added per-use prompt for apps requesting access to all device logs, giving users the ability to allow or deny access.
  • introduced the Android Virtualization Framework (AVF), which brings together different hypervisors under one framework with standardized APIs. It provides secure and private execution environments for executing workloads isolated by hypervisor.
  • Introduced APK signature scheme v3.1 All new key rotations that use apksigner will use the v3.1 signature scheme by default to target rotation for Android 13 and higher.

Check out our full AOSP release notes and the Android Developer features and changes list.

安卓12

每個 Android 版本都包含數十項安全增強功能來保護使用者。以下是 Android 12 中提供的一些主要安全增強功能:

  • Android 12 引入了BiometricManager.Strings API ,它為使用 BiometricPrompt 進行身份驗證的應用程式提供本地化字串。這些字串旨在實現裝置感知,並提供有關可以使用哪種身份驗證類型的更多特異性。 Android 12 也支援螢幕下指紋感應器
  • 增加了對屏下指紋感應器的支持
  • 指紋Android介面定義語言(AIDL)簡介
  • 支援新的Face AIDL
  • 引入 Rust 作為平台開發語言
  • 新增了用戶僅授予其大致位置存取權限的選項
  • 當應用程式使用攝影機或麥克風時,狀態列上新增了隱私指示器
  • Android 的私有運算核心 (PCC)
  • 新增了禁用 2G 支援的選項

安卓11

Every Android release includes dozens of security enhancements to protect users. For a list of some of the major security enhancements available in Android 11, see the Android Release Notes.

安卓10

每個 Android 版本都包含數十項安全增強功能來保護使用者。 Android 10 包含多項安全性和隱私增強功能。有關Android 10 中更改的完整列表,請參閱 Android 10 發行說明

安全

邊界消毒劑

Android 10 在藍牙和編解碼器中部署了BoundsSanitizer (BoundSan) 。 BoundSan 使用 UBSan 的邊界消毒劑。此緩解措施是在每個模組層級啟用的。它有助於確保 Android 關鍵元件的安全,不應被停用。 BoundSan 在以下編解碼器中啟用:

  • libFLAC
  • libavcdec
  • libavcenc
  • libhevcdec
  • libmpeg2
  • libopus
  • libvpx
  • libspeexresampler
  • libvorbisidec
  • libaac
  • libxaac

只執行記憶體

預設情況下,AArch64 系統二進位檔案的可執行程式碼部分被標記為僅執行(不可讀取),作為即時程式碼重複使用攻擊的強化緩解措施。將資料和程式碼混合在一起的程式碼以及有目的地檢查這些部分的程式碼(無需首先將記憶體段重新映射為可讀)不再起作用。如果目標 SDK 為 Android 10(API 等級 29 或更高)的應用程式嘗試讀取記憶體中啟用只執行記憶體 (XOM) 的系統函式庫的程式碼部分,而不先將該部分標記為可讀,則會受到影響。

擴展訪問

信任代理是 Smart Lock 等三級身份驗證機制使用的底層機制,在 Android 10 中只能延長解鎖時間。信任代理無法再解鎖鎖定的設備,並且只能將設備保持解鎖狀態最多四個小時。

臉部認證

人臉驗證允許用戶只需查看設備正面即可解鎖設備。 Android 10 增加了對新的人臉身份驗證堆疊的支持,該堆疊可以安全地處理相機幀,從而在受支援的硬體上進行人臉身份驗證期間保護安全性和隱私。 Android 10 也為安全相容實施提供了一種簡單的方法,以實現線上銀行或其他服務等交易的應用程式整合。

整數溢位清理

Android 10 在軟體編解碼器中啟用整數溢位清理 (IntSan) 。確保設備硬體不支援的任何編解碼器的播放性能是可接受的。 IntSan 在以下編解碼器中啟用:

  • libFLAC
  • libavcdec
  • libavcenc
  • libhevcdec
  • libmpeg2
  • libopus
  • libvpx
  • libspeexresampler
  • libvorbisidec

模組化系統組件

Android 10模組化了一些 Android 系統元件,並使它們能夠在正常的 Android 發布週期之外進行更新。一些模組包括:

OEM加密

Android 10 使用 OEMCrypto API 版本 15。

斯庫多

Scudo是一種動態使用者模式記憶體分配器,旨在更好地抵禦堆疊相關漏洞。它提供標準 C 分配和釋放原語以及 C++ 原語。

影子呼叫堆疊

ShadowCallStack (SCS)是一種LLVM 偵測模式,透過將函數的回傳位址儲存到非葉函數的函數序言中單獨指派的ShadowCallStack實例,並從ShadowCallStack實例載入傳回位址來防止傳回位址覆蓋(如堆疊緩衝區溢出)。函數結語。

WPA3 和 Wi-Fi 增強開放

Android 10 增加了對Wi-Fi 保護存取 3 (WPA3) 和 Wi-Fi 增強開放安全標準的支持,以提供更好的隱私性和抵禦已知攻擊的穩健性。

隱私

針對 Android 9 或更低版本時的應用程式訪問

如果您的應用程式在 Android 10 或更高版本上運行,但面向 Android 9(API 等級 28)或更低版本,則平台將套用下列行為:

  • 如果您的應用程式為ACCESS_FINE_LOCATIONACCESS_COARSE_LOCATION宣告了<uses-permission>元素,系統會在安裝過程中自動為ACCESS_BACKGROUND_LOCATION新增<uses-permission>元素。
  • 如果您的應用程式要求ACCESS_FINE_LOCATIONACCESS_COARSE_LOCATION ,系統會自動將ACCESS_BACKGROUND_LOCATION新增至要求中。

後台活動限制

從 Android 10 開始,系統對從後台啟動 Activity 進行了限制。此行為變更有助於最大程度地減少對使用者的干擾,並使使用者更好地控制螢幕上顯示的內容。只要您的應用程式啟動活動是使用者互動的直接結果,您的應用程式很可能不會受到這些限制的影響。
要了解有關從後台啟動活動的推薦替代方案的更多信息,請參閱有關如何提醒用戶應用程式中的時間敏感事件的指南。

相機元數據

Android 10 更改了getCameraCharacteristics()方法預設回傳的資訊的廣度。特別是,您的應用程式必須具有CAMERA權限才能存取此方法的傳回值中包含的潛在裝置特定元資料。
要了解有關這些變更的更多信息,請參閱有關需要權限的相機欄位的部分。

剪貼簿數據

除非您的應用程式是預設輸入法編輯器 (IME)或是目前具有焦點的應用,否則您的應用程式無法存取 Android 10 或更高版本上的剪貼簿資料。

設備位置

為了支援使用者對應用程式存取位置資訊的額外控制,Android 10 引入了ACCESS_BACKGROUND_LOCATION權限。
ACCESS_FINE_LOCATIONACCESS_COARSE_LOCATION權限不同, ACCESS_BACKGROUND_LOCATION權限僅影響應用程式在背景執行時對位置的存取。除非滿足以下條件之一,否則應用程式將被視為在背景存取位置:

  • 屬於該應用程式的活動可見。
  • 該應用程式正在運行一個前台服務,該服務已聲明前台服務類型location
    若要聲明應用程式中服務的前台服務類型,請將應用程式的targetSdkVersioncompileSdkVersion設定為29或更高。詳細了解前台服務如何繼續使用者發起的需要存取位置的操作

外部儲存

預設情況下,面向 Android 10 及更高版本的應用程式會獲得對外部儲存或範圍儲存的有限存取權。此類應用程式可以查看外部儲存裝置中的以下類型的文件,而無需請求任何與儲存相關的使用者權限:

要了解有關作用域存儲以及如何共享、訪問和修改保存在外部存儲設備上的文件的更多信息,請參閱有關如何管理外部存儲中的文件以及訪問和修改媒體文件的指南。

MAC位址隨機化

在運行 Android 10 或更高版本的裝置上,系統預設傳輸隨機 MAC 位址。
如果您的應用程式處理企業使用案例,該平台會提供用於與 MAC 位址相關的多個操作的 API:

  • 取得隨機 MAC 位址:裝置擁有者應用程式和設定檔擁有者應用程式可以透過呼叫getRandomizedMacAddress()來擷取分配給特定網路的隨機 MAC 位址。
  • 取得實際的出廠 MAC 位址:裝置擁有者應用程式可以透過呼叫getWifiMacAddress()來擷取裝置的實際硬體 MAC 位址。此方法對於追蹤設備群很有用。

不可重置的裝置標識符

從 Android 10 開始,應用程式必須擁有READ_PRIVILEGED_PHONE_STATE特權才能存取裝置的不可重置標識符,其中包括 IMEI 和序號。

如果您的應用程式沒有權限,並且您嘗試詢問有關不可重置標識符的信息,則平台的響應會根據目標 SDK 版本而有所不同:

  • 如果您的應用程式面向 Android 10 或更高版本,則會發生SecurityException
  • 如果您的應用程式面向 Android 9(API 等級 28)或更低版本,且該應用程式具有READ_PHONE_STATE權限,則該方法將傳回null或占位符資料。否則,將會發生SecurityException

身體活動識別

Android 10 為需要檢測使用者步數或對使用者身體活動(例如步行、騎自行車或乘車移動)進行分類的應用引入了android.permission.ACTIVITY_RECOGNITION運行時權限。這樣做的目的是讓用戶了解如何在「設定」中使用裝置感測器資料。
Google Play 服務中的某些程式庫(例如Activity Recognition APIGoogle Fit API )不會提供結果,除非使用者授予您的應用程式此權限。
裝置上唯一需要您聲明此權限的內建感測器步數計數器步數偵測器感測器。
如果您的應用程式是針對 Android 9(API 等級 28)或更低版本,且您的應用程式符合以下每個條件,系統會根據需要自動向您的應用程式授予android.permission.ACTIVITY_RECOGNITION權限:

  • 清單檔案包含com.google.android.gms.permission.ACTIVITY_RECOGNITION權限。
  • 清單檔案包含android.permission.ACTIVITY_RECOGNITION權限。

如果系統自動授予android.permission.ACTIVITY_RECOGNITION權限,則在您將應用程式更新至面向 Android 10 後,您的應用程式將保留該權限。但是,使用者可以隨時在系統設定中撤銷該權限。

/proc/net 檔案系統限制

在運行 Android 10 或更高版本的裝置上,應用程式無法存取/proc/net ,其中包含有關裝置網路狀態的資訊。需要存取此資訊的應用程式(例如 VPN)應使用NetworkStatsManagerConnectivityManager類別。

從 UI 中刪除的權限群組

從 Android 10 開始,應用程式無法尋找權限在 UI 中的分組方式。

刪除聯絡人親和力

從 Android 10 開始,平台不再追蹤聯絡人親緣關係資訊。因此,如果您的應用程式對使用者的聯絡人進行搜索,結果不會按互動頻率排序。
有關ContactsProvider的指南包含一個通知,描述了從 Android 10 開始的所有裝置上已過時的特定欄位和方法

限制存取螢幕內容

為了保護使用者的螢幕內容,Android 10 透過更改READ_FRAME_BUFFERCAPTURE_VIDEO_OUTPUTCAPTURE_SECURE_VIDEO_OUTPUT權限的範圍來防止對裝置螢幕內容的靜默存取。從 Android 10 開始,這些權限僅限於簽名存取
需要存取裝置螢幕內容的應用程式應使用MediaProjection API,該 API 會顯示一條提示,要求使用者提供同意。

USB 裝置序號

如果您的應用程式面向 Android 10 或更高版本,則在使用者授予您的應用程式存取 USB 裝置或配件的權限之前,您的應用程式無法讀取序號。
要了解有關使用 USB 設備的更多信息,請參閱有關如何配置 USB 主機的指南。

無線上網

面向 Android 10 或更高版本的應用程式無法啟用或停用 Wi-Fi。 WifiManager.setWifiEnabled()方法始終傳回false
如果您需要提示使用者啟用和停用 Wi-Fi,請使用設定面板

直接存取已設定 Wi-Fi 網路的限制

為了保護使用者隱私,Wi-Fi 網路清單的手動配置僅限於系統應用程式和裝置策略控制器 (DPC) 。給定的 DPC 可以是裝置擁有者或設定檔擁有者。
如果您的應用程式面向 Android 10 或更高版本,且它不是系統應用程式或 DPC,則以下方法不會傳回有用的資料:

安卓9

每個 Android 版本都包含數十項安全增強功能以保護用戶。有關 Android 9 中提供的一些主要安全增強功能的列表,請參閱Android 發行說明

安卓8

Every Android release includes dozens of security enhancements to protect users. Here are some of the major security enhancements available in Android 8.0:

  • Encryption. Added support to evict key in work profile.
  • 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.
  • Lock screen. Added support for using tamper-resistant hardware to verify lock screen credential.
  • KeyStore. Required key attestation for all devices that ship with Android 8.0+. Added ID attestation support to improve Zero Touch Enrollment.
  • 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.
  • Kernel hardening. Implemented hardened usercopy, PAN emulation, read-only after init, and KASLR.
  • 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.
  • Install unknown apps. Users must grant permission to install apps from a source that isn't a first-party app store.
  • 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.

安卓7

Every Android release includes dozens of security enhancements to protect users. Here are some of the major security enhancements available in Android 7.0:

  • File-based encryption. 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.
  • 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.
  • 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.
  • SELinux. Updated SELinux configuration and increased seccomp coverage further locks down the application sandbox and reduces attack surface.
  • 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.
  • APK signature scheme v2. Introduced a whole-file signature scheme that improves verification speed and strengthens integrity guarantees.
  • 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.
  • Network Security Config. Configure network security and TLS through a declarative configuration file.

安卓6

每個 Android 版本都包含數十項安全增強功能以保護用戶。以下是 Android 6.0 中提供的一些主要安全增強功能:

  • 運行時權限。應用程序在運行時請求權限,而不是在應用程序安裝時被授予。用戶可以打開和關閉 M 和 pre-M 應用程序的權限。
  • 驗證啟動。在執行之前對系統軟件進行一組加密檢查,以確保手機從引導加載程序一直到操作系統都是健康的。
  • 硬件隔離安全。指紋 API、鎖屏、設備加密和客戶端證書使用新的硬件抽象層 (HAL) 來保護密鑰免受內核洩露和/或本地物理攻擊
  • 指紋。現在只需輕輕一按即可解鎖設備。開發人員還可以利用新的 API 來使用指紋來鎖定和解鎖加密密鑰。
  • SD卡採用。設備可以採用可移動媒體並為應用程序本地數據、照片、視頻等擴展可用存儲空間,但仍受塊級加密保護。
  • 明文流量。開發人員可以使用新的 StrictMode 來確保他們的應用程序不使用明文。
  • 系統強化。通過 SELinux 實施的策略強化系統。這提供了更好的用戶隔離、IOCTL 過濾、減少暴露服務的威脅、進一步收緊 SELinux 域以及極其有限的 /proc 訪問。
  • USB 訪問控制:用戶必須確認允許 USB 訪問手機上的文件、存儲或其他功能。現在,默認僅對需要用戶明確批准的存儲訪問收費

安卓5

5.0

Every Android release includes dozens of security enhancements to protect users. Here are some of the major security enhancements available in Android 5.0:

  • Encrypted by default. On devices that ship with L out-of-the-box, full disk encryption is enabled by default to improve protection of data on lost or stolen devices. Devices that update to L can be encrypted in Settings > Security.
  • Improved full disk encryption. The user password is protected against brute-force attacks using scrypt and, where available, the key is bound to the hardware keystore to prevent off-device attacks. As always, the Android screen lock secret and the device encryption key are not sent off the device or exposed to any application.
  • Android sandbox reinforced with SELinux. Android now requires SELinux in enforcing mode for all domains. 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.
  • Smart Lock. Android now includes trustlets that provide more flexibility for unlocking devices. For example, 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.
  • 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.
  • 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.
  • 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.
  • non-PIE linker support removed. Android now requires all dynamically linked executables to support PIE (position-independent executables). This enhances Android’s address space layout randomization (ASLR) implementation.
  • FORTIFY_SOURCE improvements. 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.
  • 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 4 及更低版本

Every Android release includes dozens of security enhancements to protect users. The following are some of the security enhancements available in Android 4.4:

  • Android sandbox reinforced with SELinux. Android now uses SELinux in enforcing mode. SELinux is a mandatory access control (MAC) system in the Linux kernel used to augment the existing discretionary access control (DAC) based security model. This provides additional protection against potential security vulnerabilities.
  • Per User VPN. On multi-user devices, VPNs are now applied per user. This can allow a user to route all network traffic through a VPN without affecting other users on the device.
  • ECDSA Provider support in AndroidKeyStore. Android now has a keystore provider that allows use of ECDSA and DSA algorithms.
  • Device Monitoring Warnings. Android provides users with a warning if any certificate has been added to the device certificate store that could allow monitoring of encrypted network traffic.
  • FORTIFY_SOURCE. Android now supports FORTIFY_SOURCE level 2, and all code is compiled with these protections. FORTIFY_SOURCE has been enhanced to work with clang.
  • Certificate Pinning. Android 4.4 detects and prevents the use of fraudulent Google certificates used in secure SSL/TLS communications.
  • Security Fixes. Android 4.4 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.

Every Android release includes dozens of security enhancements to protect users. The following are some of the security enhancements available in Android 4.3:

  • Android sandbox reinforced with SELinux. This release strengthens the Android sandbox using the SELinux mandatory access control system (MAC) in the Linux kernel. SELinux reinforcement is invisible to users and developers, and adds robustness to the existing Android security model while maintaining compatibility with existing applications. To ensure continued compatibility this release allows the use of SELinux in a permissive mode. This mode logs any policy violations, but will not break applications or affect system behavior.
  • No setuid/setgid programs. Added support for filesystem capabilities to Android system files and removed all setuid/setguid programs.  This reduces root attack surface and the likelihood of potential security vulnerabilities.
  • ADB Authentication. Since Android 4.2.2, connections to ADB are authenticated with an RSA keypair. This prevents unauthorized use of ADB where the attacker has physical access to a device.
  • Restrict Setuid from Android Apps. The /system partition is now mounted nosuid for zygote-spawned processes, preventing Android applications from executing setuid programs. This reduces root attack surface and the likelihood of potential security vulnerabilities.
  • Capability bounding. Android zygote and ADB now use prctl(PR_CAPBSET_DROP) to drop unnecessary capabilities prior to executing applications. This prevents Android applications and applications launched from the shell from acquiring privileged capabilities.
  • AndroidKeyStore Provider. Android now has a keystore provider that allows applications to create exclusive use keys. This provides applications with an API to create or store private keys that cannot be used by other applications.
  • KeyChain isBoundKeyAlgorithm. Keychain API now provides a method (isBoundKeyType) that allows applications to confirm that system-wide keys are bound to a hardware root of trust for the device. This provides a place to create or store private keys that cannot be exported off the device, even in the event of a root compromise.
  • NO_NEW_PRIVS. Android zygote now uses prctl(PR_SET_NO_NEW_PRIVS) to block addition of new privileges prior to execution application code. This prevents Android applications from performing operations which can elevate privileges via execve. (This requires Linux kernel version 3.5 or greater).
  • FORTIFY_SOURCE enhancements. Enabled FORTIFY_SOURCE on Android x86 and MIPS and fortified strchr(), strrchr(), strlen(), and umask() calls. This can detect potential memory corruption vulnerabilities or unterminated string constants.
  • Relocation protections. Enabled read only relocations (relro) for statically linked executables and removed all text relocations in Android code. This provides defense in depth against potential memory corruption vulnerabilities.
  • Improved EntropyMixer. EntropyMixer now writes entropy at shutdown / reboot, in addition to periodic mixing. This allows retention of all entropy generated while devices are powered on, and is especially useful for devices that are rebooted immediately after provisioning.
  • Security Fixes. Android 4.3 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 提供了Android 安全概述中描述的多層安全模型。 Android 的每次更新都包含數十項安全增強功能,以保護用戶。以下是 Android 4.2 中引入的一些安全增強功能:

  • 應用程序驗證- 用戶可以選擇啟用“驗證應用程序”並在安裝之前讓應用程序驗證者篩選應用程序。應用程序驗證可以在用戶嘗試安裝可能有害的應用程序時提醒用戶;如果應用程序特別糟糕,它可以阻止安裝。
  • 對高級 SMS 的更多控制- 如果應用程序嘗試將 SMS 發送到使用高級服務的短代碼,Android 將提供通知,這可能會導致額外費用。用戶可以選擇是允許應用程序發送消息還是阻止它。
  • 永遠在線的 VPN - 可以配置 VPN,以便應用程序在建立 VPN 連接之前無法訪問網絡。這可以防止應用程序通過其他網絡發送數據。
  • 證書固定- Android 核心庫現在支持證書固定。如果證書未鏈接到一組預期證書,則固定域將收到證書驗證失敗。這可以防止證書頒發機構受到可能的損害。
  • 改進的 Android 權限顯示- 權限已組織成更易於用戶理解的組。在查看權限時,用戶可以點擊該權限,查看該權限的更多詳細信息。
  • installd 強化- installd守護程序不以 root 用戶身份運行,從而減少了 root 權限升級的潛在攻擊面。
  • 初始化腳本強化- 初始化腳本現在應用O_NOFOLLOW語義來防止與符號鏈接相關的攻擊。
  • FORTIFY_SOURCE - Android 現在實現FORTIFY_SOURCE 。系統庫和應用程序使用它來防止內存損壞。
  • ContentProvider 默認配置- 以 API 級別 17 為目標的應用程序將默認將每個Content Provider的“export”設置為“false”,從而減少應用程序的默認攻擊面。
  • Cryptography - 修改 SecureRandom 和 Cipher.RSA 的默認實現以使用 OpenSSL。使用 OpenSSL 1.0.1 添加了對 TLSv1.1 和 TLSv1.2 的 SSL 套接字支持
  • 安全修復- 帶有安全修復的升級開源庫包括 WebKit、libpng、OpenSSL 和 LibXML。 Android 4.2 還包括針對 Android 特定漏洞的修復。有關這些漏洞的信息已提供給開放手機聯盟成員,Android 開源項目中提供了修復程序。為提高安全性,一些裝有較早版本 Android 的設備也可能包含這些修復程序。

Android 提供了Android 安全概述中描述的多層安全模型。 Android 的每次更新都包含數十項安全增強功能,以保護用戶。以下是 Android 版本 1.5 到 4.1 中引入的一些安全增強功能:

安卓 1.5
  • ProPolice 防止堆棧緩衝區溢出 (-fstack-protector)
  • safe_iop 減少整數溢出
  • 擴展 OpenBSD dlmalloc 以防止雙重 free() 漏洞並防止塊合併攻擊。塊合併攻擊是利用堆損壞的常用方法。
  • OpenBSD calloc 在內存分配期間防止整數溢出
安卓 2.3
  • 格式字符串漏洞保護(-Wformat-security -Werror=format-security)
  • 基於硬件的 No eXecute (NX) 可防止在堆棧和堆上執行代碼
  • Linux mmap_min_addr 以減輕空指針取消引用權限升級(在 Android 4.1 中進一步增強)
安卓4.0
地址空間佈局隨機化 (ASLR) 用於隨機化內存中的關鍵位置
安卓4.1
  • PIE(位置獨立可執行文件)支持
  • 只讀重定位/立即綁定 (-Wl,-z,relro -Wl,-z,now)
  • dmesg_restrict 啟用(避免洩漏內核地址)
  • 啟用 kptr_restrict(避免洩漏內核地址)