Closed derlaft closed 2 years ago
When bootloader is locked you can't replace kernels, ok. But when bootloader is unlocked you can replace kernels from fastboot or any other flashing methods. Adding twrp password is only meaningful when usb port is broken and kernel can only be flash from the device.
After writing I saw the 'relock' step. Except hammerhead (maybe other nexus devices), relocking with not signed kernel result in brick. (some LG and all Xperia)
When bootloader is locked you can't replace kernels, ok.
Just tried -- I can. Not from fastboot, but from TWRP. Maybe this varies on device (I guess HTC with their S-ON are not eglible for this)
After writing I saw the 'relock' step. Except hammerhead (maybe other nexus devices), relocking with not signed kernel result in brick. (some LG and all Xperia)
OK, now I see. Everything is pretty sad then
Anyway password for TWRP still IS a good feature because in 99% people don't carry laptops aroud to flash bad fw to your phone AND they need a customized images for your phone (there are none in my personal case). But any cool-hax0r kid is so damn inclined to poke around with rebooting a phone in recovery mode just to show how beg l33t haxx0r he is and do things that you, as the owner, definitely DO NOT want him to do! THIS IS A MUST HAVE!
Just encrypt with password on boot in Android. Problem solved.
This isn't an actual TWRP issue. The only solution is what I said. TWRP won't be getting password protection, so I wanted to make sure everyone understands that's the best solution for now. Between dm-verity and forced encryption, this is a non-issue to me and apparently the TWRP developers too. I think there are forks of TWRP that have added this feature; maybe the OP can try one of them.
I'm totally agree with @derlaft
The main problem that mostly devices can't lock bootloader after custom recovery. But we can find workaround how to protect device in this case. For example if your phone restarted not by you:
Let's imagine if TWRP has password protection - in this case you can try to type TWRP password(different to android password). If password not accepted - it means somebody changed recovery via fastboot.
If password fine then you can login to TWRP and open terminal. You can check sha256sum for recovery, boot partitions. If hash sum doesn't match with previous times it's a reason for reinstall whole system from your previos clear back-up's.
De-facto everybody can restart my android in TWRP recovery right now and get root access via TWRP Terminal. Then change system/boot files which can compromise my next system start.
So TWRP password feature it is not solution for protect user data. But it's a way how to protect unlocked bootloader against to install rootkit's, keyloggers or using other vulnerabilities via fastboot or adb sideload.
It seems that nowadays it should be possible to relock bootloader with a custom firmware: https://forum.xda-developers.com/t/guide-re-locking-the-bootloader-with-a-pre-built-custom-rom-such-as-lineageos-official.4260825/
While TWRP functionality might be partially limited in this mode, it might still be used (to flash signed images and to produce backups).
Just encrypt with password on boot in Android. Problem solved.
But pretty much yes, even in locked mode TWRP won't be able to access user data without a password and flash unsigned firmware. Therefore there's not really a reason to protect it with a password.
This is a reply for https://twrp.me/faq/securetwrp.html article.
TL;DR: because of chain of trust
This does not work if the recovery is not protected somehow. Anyone can silently add a keylogger to /system partition and easily decrypt all the /data files.
Let's see how the vanilla data protection works:
Results: firmware can only be modified by a vendor, so nobody else can decrypt /data using a keylogger attack.
How everything could work if TWRP had a password protection:
Results: you have both a full control of your firmware and a security profit from a locked bootloader.