3

When I first started learning about installing custom ROMs like LineageOS, it wasn't long before I was made aware of the security implications involved, particularly with unlocking the bootloader. The rooting is not as big an issue in itself once the custom ROM installed from what I know. The ROMs come with things preinstalled and configured the way they should be. Rooting more risky for security on a non-flashed device, but in the case of installing a custom ROM, it's still important to know the implications of leaving the bootloader unlocked.

The device I had at the time was a Galaxy A20 and not officially Lineage supported. Being my first Galaxy device, I noticed this new feature set called Knox. From what I know about Knox it is a hardware-based security scheme. This sounded like something pretty fail-safe to me when I first heard about it, and something that would probably be better left alone.

When I first learned that rooting has the side affect of affecting your device's security, in the particular case of my Galaxy device, Samsung Knox was one of the first things that crossed my mind. I can only assume that rooting the device would nullify most of the benefits of the Knox security platform.

It was at this point I decided that, as much as I may want to de-Google my phone, until I upgrade to an officially supported Lineage device, a custom ROM would probably not be ideal for my case with the A20 running Samsung Knox, due to the security implications involved.

For context, I'm a longtime Tracfone user and have never invested much into my mobile device. The last couple phones I've owned have had enough limitations and missing features to persuade me to upgrade early. I finally decided to step it up and upgrade to a Galaxy S10e. This device is officially supported by LineageOS, but being a Galaxy model, it still has Samsung Knox. I am excited to finally own a custom ROM officially supported device, but again, my primary reason for upgrading was the storage space and feature set. I'm still trying to weigh the benefits between testing Lineage and giving up Knox.

Perhaps a Pixel with Graphene would be a better device to de-Google but I am new to custom ROMs so between what I learned about having an unlocked bootloader and the benefits of running Samsung Knox, I've sort of reached a point of needing more info on Knox. I don't really know the specifics of what I'd be giving up by rooting a Knox device. I am aware of some of the soft features such as secure folder and secure WiFi. That's about it though. Some reviews even indicate it might not be all it's played up to be. But this page from Samsung's website has me pretty sold on its ability to block advanced attack methods by implementing government grade-security. Reminds me of some new PC features like secure boot and core isolation.

I need to ensure my device's data is protected and safe if lost or stolen. Some of what I've read has made me wonder if this is even a use case for Knox. It seems like it according to Samsung though. It then occurred to me, "can I 're-lock' the bootloader, so to speak?" If I were to do this, would it be at all comparable to my formerly Knox-secured device? Is it even possible?

That's when I discovered that Android has something called user-settable root of trust. The problem with locking the bootloader after flashing a custom ROM is the risk of the bricking the device. From what I can tell, this is where user-settable root of trust comes in. On certain Android devices, the user can add the new ROM as a valid signature when the device boots.

So in summary it appears one thing I can be sure of is that if I root a Galaxy device, I will be giving up Samsung Knox because the Knox Warranty Bit will be tripped. But perhaps there is a way to either encrypt the device or implement user-settable root of trust, depending on the device. Would such a device keep its data secure if lost or stolen and how well would this compare to stock ROM running Knox?

1
  • 1
    To my understanding a triggered Knox Warranty Bit does not mean all security is disabled on Samsung devices. A lot of Knox features deal with MDM features and detecting "illegal states" (like rooted devices) remotely in a way that can not be bypassed easily. These are the features that do no longer work with a triggered Knox Warranty Bit.
    – Robert
    Feb 27, 2023 at 8:15

1 Answer 1

4

First of all, rooting does not make your device insecure by design. It adds one more opportunity in the list of existing attack vectors that can be used to compromise your device with no guarantee of success. This opportunity is more intriguing to compromise because gaining root privileges as an attacker just yields more benefits than compromising the device with any other attack vector. Having knowledge of presence of root on a device is not enough to compromise it though. There is no guarantee of success here either. As much as it is hard for the attacker to gain root access, it is also as hard for you to maintain the operational security of the rooted device which is why it is not recommended to have.

Samsung Knox is a ARM's TrustZone based integrated TEE chip which is a mandatory standard in android 8+ devices. The features TEE offers are provisioned by OEMs in the form of Trusted Apps (TAs) inside TEE. To support android keystore system, TEE is provisioned with the same set of features that are common across android devices. These features are:

  1. Storage encryption, Screen lock authentication & Biometrics
  2. Cryptographic operations
  3. Hardware-backed Play Integrity attestation (previously called SafetyNet)
  4. Google Widevine L1 DRM
  5. NFC payment

Because of project Treble, custom ROMs do not have to modify the vendor partition that contains Hardware Abstraction Layers (HALs) which support the hardware including TEE, so all of the features mentioned above will work fine with custom ROMs with the exclusion of Google Widevine L1 DRM and NFC payment. That is because TEE does not actually protects the OS, it protects itself from the OS and as an extension, its own security gives protection to some of the components of the OS too. As DRM contents and NFC transactions can be tampered with by a compromised OS, their trusted apps are disabled when the bootloader is unlocked or when custom AVB is set.

Samsung provisions custom trusted apps in Knox that are not covered by android specs. They have listed 5 of them in their blog. These are mobile device management and enterprise mobile management features. These will not work in an unlocked bootloader and I don't think they are of any use to you anyway. They are 2 more interesting features offered by Knox for consumer devices explained here:

Samsung Knox adds an enhancement called Trusted Boot, which goes a step further by taking snapshots during the boot process and storing the results in the TrustZone Trusted Execution Environment (TEE). The goal of Trusted Boot is to ensure that older, trusted bootloaders that might have security vulnerabilities in them can’t be used, as part of the Rollback Prevention process. As the system is booting, TrustZone Trustlets check the snapshots. If they determine that an older bootloader was used, certain security-critical operations can be blocked.

I am not sure how it is different from embedding minimum allowed version of the bootloader into eFuse. Google Pixel did it last year.

Real-time Kernel Protection (RKP) & Periodic Kernel Measurement (PKM)

PKM is a passive check: It is software that runs in the TrustZone TEE regardless if anything is trying to touch the Android kernel. PKM periodically checks the kernel to detect if code or data have been modified by malicious software. PKM also checks the integrity of key data structures used by SE for Android to detect attempts to disable those security checks.

RKP is an active security check designed to block tampering with the kernel. With RKP, critical kernel events are intercepted and inspected in the TrustZone TEE. Events that impact the kernel can be blocked or logged to indicate suspected tampering.

This will not be available when you will flash custom ROM. The real cost of flashing custom ROM is explained in this article, Samsung will let you unlock your Z Fold 3’s bootloader, but at the cost of your cameras.

Samsung’s Knox documentation says that, if you root your phone and flash it with an unofficial Android build, anything having to do with its Knox security will be permanently disabled, and will only be restored if you replace the phone’s hardware. This means that, if you root a Samsung phone, features like Samsung Pay and Secure Folder won’t ever work again. To be clear, this doesn’t happen if you just unlock your phone’s bootloader — it only occurs after you make changes to the phone’s OS (though doing so is the main reason to unlock your bootloader, so it’s perhaps a distinction without much difference).

It makes no sense for Samsung to permanently kills hardware features. TEE is designed to be tamper resistant so even with root access, it can't be tampered with. Samsung should restore Knox features after reverting the phone back to its factory state. It is understandable to permanently revoke warranty but the reason of killing other features cannot be explained by infosec and makes it look like a poor engineering design.

Near Knox level security is not possible to achieve with rooted custom ROM as you won't be able to use specific features of Knox. I also don't think that you need to have Knox fully operational in order to be secure. It depends on your threat model. As long as your purpose is achieved with common android security features of TEE and you have custom AVB enabled, a good operational security of your device is enough for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .