GrapheneOS protections against data extraction from locked devices

GrapheneOS protections against data extraction from locked devices

GrapheneOS 针对锁定设备数据提取的防护机制

GrapheneOS has strong defenses against data extraction. It heavily builds upon the standard security features provided by Android 17 and the most secure hardware available for Android. Currently, only Pixels provide the hardware security features and updates required by GrapheneOS. That’s going to change in 2027 thanks to our partnership with Motorola Mobility and progress being made by Qualcomm.

GrapheneOS 拥有强大的数据提取防御能力。它深度构建于 Android 17 提供的标准安全功能以及 Android 平台所能提供的最安全硬件之上。目前,只有 Pixel 设备能够提供 GrapheneOS 所需的硬件安全功能和更新。得益于我们与摩托罗拉移动(Motorola Mobility)的合作以及高通(Qualcomm)取得的进展,这一现状将在 2027 年发生改变。

Disk encryption provides strong protection for data. Even the most sophisticated attackers aren’t going to be directly breaking it. They either need to exploit the OS while in After First Unlock state or brute force the PIN/password.

磁盘加密为数据提供了强有力的保护。即使是最老练的攻击者也无法直接破解它。他们要么需要在设备处于“首次解锁后”(After First Unlock)状态时利用操作系统漏洞,要么只能通过暴力破解 PIN 码或密码。

Android 16 QPR2 calls for a secure element implementing rate limiting ramping up delays. It’s 4 hours after 10 and 41 days after 15. Only 20 attempts are allowed. For usability, It rejects the most recent 5 unique failed attempts early to avoid wasting attempts on repeated errors. GrapheneOS only supports devices implementing the latest generation secure element rate limiting.

Android 16 QPR2 要求安全元件(Secure Element)实现速率限制,以增加延迟。在 10 次尝试后延迟为 4 小时,15 次后则长达 41 天。总共仅允许 20 次尝试。为了提升易用性,系统会提前拒绝最近 5 次重复的失败尝试,以避免因重复错误而浪费尝试次数。GrapheneOS 仅支持实现了最新一代安全元件速率限制的设备。

https://source.android.com/docs/security/features/authentication/rate-limiting

(参考链接:https://source.android.com/docs/security/features/authentication/rate-limiting)

The secure element on the supported devices also has insider attack resistance. That’s implemented by requiring the Owner user to successfully authenticate before the secure element firmware can be updated. A valid signing key and greater version number aren’t enough alone. The purpose of this is preventing any government from bypassing the rate limiting by coercing the creation of a firmware update removing the rate limit.

受支持设备上的安全元件还具备“内部攻击防御”(insider attack resistance)能力。其实现方式是要求所有者(Owner)用户成功进行身份验证后,才能更新安全元件的固件。仅有有效的签名密钥和更高的版本号是不够的。此举旨在防止任何政府通过强制要求创建移除速率限制的固件更新,从而绕过安全限制。

Pixels have used a secure element with an internal timer implementing rate limiting and insider attack resistance since the Pixel 2 launched near the end of 2017. Here’s a post about this from back in 2018:

自 2017 年底 Pixel 2 发布以来,Pixel 设备一直使用带有内部计时器的安全元件来实现速率限制和内部攻击防御。以下是 2018 年关于此功能的一篇文章:

https://android-developers.googleblog.com/2018/05/insider-attack-resistance.html

(参考链接:https://android-developers.googleblog.com/2018/05/insider-attack-resistance.html)

The secure element and integration into the OS has become far better since then, but it shows this goes back a long way and isn’t a new feature.

自那时起,安全元件及其与操作系统的集成已经有了长足的进步,但这表明该功能由来已久,并非什么新鲜事物。

GrapheneOS also raises the character limit for passwords from 16 to 128. This enables using high entropy diceware passphrases not depending on the secure element rate limiting.

GrapheneOS 还将密码字符限制从 16 位提高到了 128 位。这使得用户可以使用高熵值的 Diceware 密码短语,而不必依赖安全元件的速率限制。

To make a strong passphrase convenient to use without ruining it with biometric unlock, GrapheneOS adds an optional 2nd factor fingerprint PIN. We reduce the allowed fingerprint attempts from 20 to 5 and failure to enter the correct 2nd factor PIN counts towards it. This enables using 6-8 random diceware words as the main unlock method required in Before First Unlock and fingerprint+PIN using a short PIN for convenience. Using a valid fingerprint prompts to enter the 2nd factor PIN which is needed to complete unlocking the screen and hardware keystore.

为了在不因生物识别解锁而降低安全性的前提下,让强密码短语使用起来更方便,GrapheneOS 增加了一个可选的“第二重指纹 PIN 码”。我们将允许的指纹尝试次数从 20 次减少到 5 次,且输入错误的第二重 PIN 码也会计入失败次数。这使得用户可以使用 6-8 个随机 Diceware 单词作为“首次解锁前”(Before First Unlock)所需的强制解锁方式,同时通过“指纹+短 PIN 码”实现便捷解锁。使用有效指纹后,系统会提示输入第二重 PIN 码,这是完成屏幕解锁和硬件密钥库解锁所必需的。

GrapheneOS greatly improves the exploit protections for the OS with hardened memory allocators and other features. It heavily uses hardware-based security features including hardware memory tagging (MTE) to protect against exploits. A partial overview of those protections is here:

GrapheneOS 通过强化内存分配器和其他功能,极大地提升了操作系统的漏洞利用防护能力。它大量使用了包括硬件内存标记(MTE)在内的硬件安全功能来抵御攻击。以下是这些防护措施的部分概述:

https://grapheneos.org/features#exploit-protection

(参考链接:https://grapheneos.org/features#exploit-protection)

GrapheneOS adds specialized protection against attacks with physical access too. For example, it blocks new USB connections at a software and hardware level by default while locked and disables USB data as soon as there are no active USB connections.

GrapheneOS 还增加了针对物理接触攻击的专门防护。例如,在设备锁定状态下,它默认会在软件和硬件层面阻止新的 USB 连接,并会在没有活跃 USB 连接时立即禁用 USB 数据传输。

GrapheneOS shipped a locked device auto-reboot timer back in June 2021. It can be set between 10 minutes and 72 hours. We enabled it by default using 72 hours and then lowered it 18 hours. It automatically returns the device to Before First Unlock state due to our memory zeroing as part of tearing down the OS and booting. We got Pixels to add memory zeroing for booting the firmware fastboot mode in April 2024. Apple and Google added a locked device auto-reboot timer in iOS 18.1 and Android 16. For Android, it can be enabled with the Android Advanced Protection Mode. Our implementation is better for multiple reasons but it’s a useful feature regardless.

GrapheneOS 早在 2021 年 6 月就推出了锁定设备自动重启计时器。该时间可设置为 10 分钟到 72 小时之间。我们最初将其默认设置为 72 小时,随后降低至 18 小时。由于我们在拆除操作系统和启动过程中执行了内存清零,设备会自动回到“首次解锁前”状态。我们促使 Pixel 设备在 2024 年 4 月增加了用于启动固件 fastboot 模式的内存清零功能。苹果和谷歌分别在 iOS 18.1 和 Android 16 中增加了锁定设备自动重启计时器。对于 Android,该功能可以通过“Android 高级保护模式”启用。我们的实现方式在多个方面更胜一筹,但无论如何,这都是一项有用的功能。

Android uses separate encryption keys for each secondary user and Private Space. GrapheneOS adds support for putting both back into Before First Unlock state without a reboot via end session for secondary users or toggles for either to do it by default. It’s still much better for the device to be rebooted to get the main user back at rest, completely clear leftover data from RAM and block secure element updates.

Android 为每个辅助用户和“私密空间”(Private Space)使用独立的加密密钥。GrapheneOS 增加了支持,允许通过结束辅助用户会话,或通过默认开关,在不重启设备的情况下将两者恢复到“首次解锁前”状态。不过,重启设备以使主用户回到静止状态、彻底清除 RAM 中的残留数据并阻止安全元件更新,依然是更好的做法。

Our duress PIN/password feature is a minor feature fitting into the bigger picture. It wipes the device when it’s entered in any OS prompt for the current profile’s PIN or password. It will wipe the device when entered into the authentication prompt for changing a sensitive setting or anything else requiring it, not only the lockscreen. It works across every profile including secondary users and Private Spaces, not only the main user. The duress PIN will also wipe the device when entered as a 2nd factor PIN for fingerprint unlock, but not a SIM PIN.

我们的“胁迫 PIN/密码”功能是一个宏观安全体系中的小功能。当在任何操作系统提示输入当前配置文件的 PIN 码或密码时输入该胁迫密码,设备就会被擦除。它不仅限于锁屏界面,在更改敏感设置或任何需要身份验证的提示中输入该密码,也会触发擦除。该功能适用于所有配置文件,包括辅助用户和私密空间,而不仅仅是主用户。当胁迫 PIN 码作为指纹解锁的第二重 PIN 码输入时,也会擦除设备,但 SIM 卡 PIN 码除外。

There are multiple ways to use the duress PIN/password feature including writing it down on a phone case or a paper kept in a wallet. People should carefully consider how to use it in an actual duress.

使用胁迫 PIN/密码功能有多种方式,包括将其写在手机壳上或放在钱包里的纸条上。用户应仔细考虑在实际面临胁迫时如何使用它。