5

Unlocking the bootloader and/or the recovery is very popular discussion across many devices. But doing so exposes a very obvious and inevitable issue with security!

An unlocked recovery means that no matter how secure you make your android lock screen, someone can easily reset phone to restore the phone to a fully functional (and lockless/insecure) state and the worst part, they don't have to erase your data(meaning they can access all your personal files and folders)!

It is almost hilarious! In fact if the phone supports insertion of external SD cards, you can even flash your own software into the phone and maybe bypass the lock screen without wiping any data.

For example: One possible loophole is using the 'Tasker' app which has a feature that can temporarily disable the keyguard. And the best part is that Tasker can be flashed using the recovery!

So is there any method by which I could add a security measure that prevents complete access to my recovery and/or boot loader that will make my phone less insecure?!

Expected answer: Method by which a custom pin/password must be entered before entering the bootloader/recovery. So that my bootloader/recovery is still technically unlocked but simply requires authentication to use (this also ensures that conventional unlocking methods won't work as the phone is not really locked!). This also means that one does not have to lose root access to ensure security!

5
  • 1
    Don't root the device. Get a device with a secure bootloader e.g. Samsung devices with KNOX bootloader... But really the only way to ensure it happens, keep your phone locked up safe (obviously not a real option). To be honest I see a lot of stolen phones on sale around the city and they were NOT rooted and still were able to factory reset, there's always tools like JTags etc out there, and websites to help you do these very things, bootloader locked or not. Even if it is locked I can get into download mode and flash a new ROM on any Samsung device.
    – RossC
    Jan 29, 2014 at 11:47
  • I was hoping for a solution that didn't involve losing root. JTags are an inevitable security issue but are at least expensive and less obvious than the gaping wide loophole that could be potentially be avoided (as described in the expected answer)...There must be a way security could be improved on a rooted android device!
    – reubenjohn
    Jan 29, 2014 at 12:43
  • I do understand what you are looking for, I just can't think of any way of doing it that someone couldn't bypass in aobut 5 minutes. I've had to do it for friends who completely locked themselves out of a device. In the case of a Friends S4 just boot into download mode (rooted or not) and just flash whatever ROM in ODIN, factory reset, all security removed immediately. The entire thing took about 15 minutes. KNOX itself will only flag that it has been tripped, but that's no good if your device is stolen! I never had to go near the bootloader etc as I just flashed a ROM with that reomoved.
    – RossC
    Jan 29, 2014 at 12:45
  • Can ODIN be ruled out if I set USB Debugging to false? And could you clarify what you mean by: "I never had to go near the bootloader etc as I just flashed a ROM with that removed"
    – reubenjohn
    Jan 29, 2014 at 12:52
  • 1
    Sorry! Not possible! You'd have to obliterate the bootloader code on the SoC to come up with custom version that will ask for PIN of some sort, prior to starting up before ever hitting on recovery.
    – t0mm13b
    Jan 29, 2014 at 14:11

7 Answers 7

4

Even if it would be doable, consider a few things making it extremely unlikely:

  1. in that early stage, the touchscreen is not yet initialized – so how would you input your PIN/password/pattern to unlock the bootloader before firing up the custom recovery?
  2. another risk introduced this way: if you break your display, you are effectively knocked-out: even if the problem described above could be worked around, that work-around would be rendered useless at this place.

True, there are things like touch-based custom recoveries. So technically, that would be the place to make it possible: Once the recovery is initialized, it could ask for a code to unlock before offering its real services. This might even include a "fallback mode" for a broken screen using e.g. shake-patterns (accelerometer-based) or NFC (if applyable). But that's nothing we can solve here at this site: you will have to contact the resp. developers for this ( and/or , to name two examples).

6

Encrypt your filesystem. You'll need to enter a password or PIN on every boot to decrypt it, so as soon as the device is rebooted none of your personal data will be readable. TWRP even supports encrypted filesystems (it prompts you for your password when it starts as well, I think). If your device is at least 4.2.2 then you can even leave ADB on; they'd need to unlock the screen to add their computer to the whitelist, so they can't push apps or read data there either. You'll be able to have root, a custom bootloader, ADB enabled, and still have a relatively secure device.

2

I recently wiped my phone to factory after I had rooted the phone and got rid of the bloatware I did not want. (Forgot the passcode) I thought I would have to root my phone again and then get rid of factory installed bloatware....again. I was pleasantly surprised to find both that the root was intact AND the bloatware was still gone. Also, my superuser app was still intact. It should have been gone, but was converted into a system APP and so was not wiped during the reset. That got me thinking along a similar line to your question.

What would happen if you were to imbed the Passcode/Pin data into the system data. You could not gain access to the phone by merely wiping it as the pass/PIN data would still be on the phone after the wipe. Of course that would mean that forgetting your pass/pin would effectively brick your phone.

Of course you could just keep ALL of your data on the SDCard and encrypt it there withan app. Then it wouldn't matter if someone flashed your phone and got access because (s)he could not access your sensitive data without BOTH the encryption app AND the app specific pass/pin.

1

couple of things.

  1. Go ahead and download the latest version of TWRP and google the UI.zip file that adds the password to custom recovery.

  2. download Cerberus app, it's the best anti theft app out there that allows you to lock, track, back up, wipe, remote call, signal flare, force GPS and wifi, and more. From the app lock the powermenu from the lock screen to refrain people from turning it off. Create a TON of rules, gps flares when the phone is powered on and off, SIM card information when the SIM is changed and a signal flare, auto passwords when the sim card is changed, ect.

  3. use a 6x6 pattern password or an actual password

  4. Use an applock system, CM security it great, set it to lock all settings and sensitive apps that could make you vulnerable in the event you lose your phone, set it to lock every 3 minutes. Once you unlock one app it unlocks them all (but for only 3 minutes).

  5. TURN OFF ADB DEBUGGING IF YOU ARE NOT USING IT! ALL of this work is useless if you don't, the LAST thing you want is for someone to sideload another ROM and screw you.

That should do it!

1
  • 1
    Nope, they can just use fastboot to flash a new version of TWRP or CWM as recovery which gives them access to flash without the password. Jul 7, 2016 at 1:16
0

The only option to be secure is a false off from xposed, locked bootloader and having second phone to make quick emergency call. It's not windows, you can't protect bios with password. I quess.

1
  • 1
    That I guess at the end though.
    – SarpSTA
    Jan 18, 2017 at 22:08
0

It is possible, say you have TWRP installed, if you encrypt the device, it will ask for the password before you can mount/change any partition

1
  • Welcome to the site, Brian, and thank you for contributing.
    – Dan Hulme
    Feb 6, 2017 at 10:08
0

It's not secure but, I just removed certain menu options from the recovery screen in the AOSP source code. It at least prevents a novice or someone without a PC from wiping your device.

You must log in to answer this question.

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