• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Android PIE VerifiedBoot Bypass: sony xperia XZ1 locked bootloader permanently rooted

Search This thread

j4nn

Senior Member
Jan 4, 2012
1,228
2,406
This thread is to announce a completely new vulnerability I've found within SONY XPERIA XZ1 Compact firmware.
It allows verified boot bypass with the latest available android pie fw (2019-09-01 security patch level, sony version 47.A.2.11.228 released on 2019-10-10).
Please see bellow for youtube video recordings showing the exploit and it's possibilities.

Permanently rooting Android PIE without bootloader unlock - SONY XPERIA XZ1 Compact Verified Boot Bypass
  1. LOS16 with locked BL
    short preview of Lineage OS 16.0 booting instead of stock fw with still locked bootloader including magisk root
    (first announced here as part of my previous kernel exploit thread)
  2. verified boot bypass:
    - fastboot-ing twrp
    - permanently flashing twrp as recovery
    - permanently rooting stock fw with magisk without unlocking bootloader
  3. LOS16 from sd card
    installing LOS16 as an alternate OS to sdcard for multiboot via recovery
  4. LOS16 instead of stock fw with locked BL
    dual booting two LOS16 installations, one replacing stock fw, the other from sd card
    replacing the 2nd LOS16 with twrp recovery being happy with just one LOS16 replacing stock fw with still locked bootloader
Playlist of all the above available here.

Vulnerability impact
This could be used to inject any software into a xperia phone, like remote root backdoor or some eavesdropping spyware.
An exploit may be implemented in a way that it could survive full firmware re-flash from computer or even system fota upgrade, including factory reset, making it very powerful.
If used with another temp (or remote) root exploit, this vulnerability may be leveraged without user noticing anything, so an attacker may do persistent changes even when bootloader is still locked with verified boot active.

Vulnerability scope
The proof of concept exploit is working with sony xperia xz1 compact phone.
It can be extended to support entire range of xperia phones running YOSHINO platform (qualcomm snapdragon 835) - XZ Premium, XZ1, XZ1 Compact (any of single/dual sim variants), including those that do not allow bootloader unlock as that is not needed.
First stage of the exploit has also been adapted for SONY XPERIA XZ2, as documented here and in following posts. That means the exploit could be extended to support entire TAMA platform, i.e. sony xperia XZ2/XZ3 (Compact/Dual/Premium) phones.
There is a chance that the exploit could be adapted to any recent xperia phone released since yoshino platform. It has not been checked/proved either way though.

What to do next
I am not sure if the exploit should be publicly released to allow rooting without bootloader unlock or if this should go the responsible disclosure way, considering the misuse risks.

Even though this exploit is very powerful, my ultimate goal is TrustZone code execution hopefully allowing to inject custom verified boot keys and bootloader re-lock.
Unfortunately I can spend less and less time working on this stuff, so I would appreciate help from other developers, particularly experienced with reverse engineering to help me find a hole to get into TrustZone / Qualcomm Secure Execution Environment (QSEE).
I have already some ideas for very promising TZ attack vectors.
Please contact me if you would like to help me with TrustZone exploit development.
Thank you.


Please keep the thread clean
Please use the thanks button if you like my work.
Please post here only when you have something with real information value. General discussion may take place in my thread here.
Thank you.

[XZ1c/XZ1/XZp] temp root exploit to backup drm keys implemented
Android Attest Key thread
https://j4nn.github.io/
https://github.com/j4nn/
 

Attachments

  • xz1c-vb-bypass1-rooting-fastboot-twrp-magisk.jpg
    xz1c-vb-bypass1-rooting-fastboot-twrp-magisk.jpg
    48.1 KB · Views: 1,151
  • xz1c-vb-bypass2-los16-to-sdcard-dualboot.jpg
    xz1c-vb-bypass2-los16-to-sdcard-dualboot.jpg
    69.3 KB · Views: 1,149
  • xz1c-vb-bypass3-los16-to-internal-flash.jpg
    xz1c-vb-bypass3-los16-to-internal-flash.jpg
    31.1 KB · Views: 1,114
Last edited:

Shady_BlackSn0w

Senior Member
Sep 8, 2014
177
50
Hi, is possible to root with locked BL on Xperia XZ2 Premium running Android 9?
@j4nn did adapt the same exploit of renoroot on the XZ2 which theoretically can be applied to the whole family since they are the same. But for now NO root on locked BL AFAIK.

So, you just flashed TWRP, LineageOS & Magisk like normal?

No, he did a lot of work in order to find a new exploit that made him able to flash TWRP and lineage on a locked bootloader and be able to dualboot if he wants to.


@j4nn said in the OP that he wants this to be clean and for developers only who can help and general discussion will be found here https://forum.xda-developers.com/xp...devonly-exploits-temp-root-to-backup-t3795510
 
Last edited:
  • Like
Reactions: SGH-i200

j4nn

Senior Member
Jan 4, 2012
1,228
2,406
@Shahnewaz, well I put it aside - it is dangerous for general folks to use - really great risk of a brick.
Also I've released two new temp root exploits - one for xz1* phones and another one for xz2* phones even allowing to use magisk from it, not difficult to start after each boot.
I would still welcome a help with TrustZone exploit development - I have some progress there, but not enough time to do it alone.
 

&(*)

Senior Member
May 8, 2020
169
7
Does the exploit for devices with LB have anything to do with treble implementation for the 835? Would like to accomplish a dual boot on XZ premium, and if possible have another that is an 820 with a LB; please advise.
 

bleustacks

New member
Dec 2, 2020
2
0
Hi everyone,
My XZ1 has "Android attest key Not Provisioned" and "Fido Key Provisioned".
i had a problem with green camera in the past, but not anymore after update to Pie.
my question is: can i root without backing up DRM keys?

Moderator Edit, removal of attachment, showing IMEI.
 
Last edited by a moderator:

j4nn

Senior Member
Jan 4, 2012
1,228
2,406
@Rhamadhany, why would you overwrite xfl partition?
What did you overwrite xfl partition with exactly?
Unfortunately I do not have a hard brick recovery method.
I have managed to get sony firehose boot image which works with xz1* EDL boot mode, but all commands are protected by sony sake auth (rsa2048), so it is not useful at all.
 

Rhamadhany

Member
Oct 23, 2020
23
0
@Rhamadhany, why would you overwrite xfl partition?
What did you overwrite xfl partition with exactly?
Unfortunately I do not have a hard brick recovery method.
I have managed to get sony firehose boot image which works with xz1* EDL boot mode, but all commands are protected by sony sake auth (rsa2048), so it is not useful at all.
I used the command dd, sorry. So there's no way to bring it back to life?
 

Rhamadhany

Member
Oct 23, 2020
23
0
@j4nn Btw I bought a new xz2 premium phone but with the docomo version. And I just found out that the docomo version can't use global rom. So can the docomo version use temproot?
 

mufidmb38

New member
Aug 5, 2016
2
0
Sony Xperia XZs

nitrams

Member
May 12, 2020
26
1
Thanks for your work @j4nn . I hope this could help in enabling volte to my sov36 and also to be able to flash dual sim fw g8432. As everytime i flash g8342 fw i get no sim detected. In regards to volte i already tried other guides here with also the help of your exploit for oreo. However still no luck and just recently i noticed camera opens but doesnt work. Hope you can release the exploit for pie of course once you got your goal about the trustzone, specially for me and others who owns sov36 variant as this doesnt allow to unlock bl. Basically what i can only do to contribute is just test builds and provide feedback.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    This thread is to announce a completely new vulnerability I've found within SONY XPERIA XZ1 Compact firmware.
    It allows verified boot bypass with the latest available android pie fw (2019-09-01 security patch level, sony version 47.A.2.11.228 released on 2019-10-10).
    Please see bellow for youtube video recordings showing the exploit and it's possibilities.

    Permanently rooting Android PIE without bootloader unlock - SONY XPERIA XZ1 Compact Verified Boot Bypass
    1. LOS16 with locked BL
      short preview of Lineage OS 16.0 booting instead of stock fw with still locked bootloader including magisk root
      (first announced here as part of my previous kernel exploit thread)
    2. verified boot bypass:
      - fastboot-ing twrp
      - permanently flashing twrp as recovery
      - permanently rooting stock fw with magisk without unlocking bootloader
    3. LOS16 from sd card
      installing LOS16 as an alternate OS to sdcard for multiboot via recovery
    4. LOS16 instead of stock fw with locked BL
      dual booting two LOS16 installations, one replacing stock fw, the other from sd card
      replacing the 2nd LOS16 with twrp recovery being happy with just one LOS16 replacing stock fw with still locked bootloader
    Playlist of all the above available here.

    Vulnerability impact
    This could be used to inject any software into a xperia phone, like remote root backdoor or some eavesdropping spyware.
    An exploit may be implemented in a way that it could survive full firmware re-flash from computer or even system fota upgrade, including factory reset, making it very powerful.
    If used with another temp (or remote) root exploit, this vulnerability may be leveraged without user noticing anything, so an attacker may do persistent changes even when bootloader is still locked with verified boot active.

    Vulnerability scope
    The proof of concept exploit is working with sony xperia xz1 compact phone.
    It can be extended to support entire range of xperia phones running YOSHINO platform (qualcomm snapdragon 835) - XZ Premium, XZ1, XZ1 Compact (any of single/dual sim variants), including those that do not allow bootloader unlock as that is not needed.
    First stage of the exploit has also been adapted for SONY XPERIA XZ2, as documented here and in following posts. That means the exploit could be extended to support entire TAMA platform, i.e. sony xperia XZ2/XZ3 (Compact/Dual/Premium) phones.
    There is a chance that the exploit could be adapted to any recent xperia phone released since yoshino platform. It has not been checked/proved either way though.

    What to do next
    I am not sure if the exploit should be publicly released to allow rooting without bootloader unlock or if this should go the responsible disclosure way, considering the misuse risks.

    Even though this exploit is very powerful, my ultimate goal is TrustZone code execution hopefully allowing to inject custom verified boot keys and bootloader re-lock.
    Unfortunately I can spend less and less time working on this stuff, so I would appreciate help from other developers, particularly experienced with reverse engineering to help me find a hole to get into TrustZone / Qualcomm Secure Execution Environment (QSEE).
    I have already some ideas for very promising TZ attack vectors.
    Please contact me if you would like to help me with TrustZone exploit development.
    Thank you.


    Please keep the thread clean
    Please use the thanks button if you like my work.
    Please post here only when you have something with real information value. General discussion may take place in my thread here.
    Thank you.

    [XZ1c/XZ1/XZp] temp root exploit to backup drm keys implemented
    Android Attest Key thread
    https://j4nn.github.io/
    https://github.com/j4nn/
    4
    @Shahnewaz, well I put it aside - it is dangerous for general folks to use - really great risk of a brick.
    Also I've released two new temp root exploits - one for xz1* phones and another one for xz2* phones even allowing to use magisk from it, not difficult to start after each boot.
    I would still welcome a help with TrustZone exploit development - I have some progress there, but not enough time to do it alone.
    1
    Hi, is possible to root with locked BL on Xperia XZ2 Premium running Android 9?
    @j4nn did adapt the same exploit of renoroot on the XZ2 which theoretically can be applied to the whole family since they are the same. But for now NO root on locked BL AFAIK.

    So, you just flashed TWRP, LineageOS & Magisk like normal?

    No, he did a lot of work in order to find a new exploit that made him able to flash TWRP and lineage on a locked bootloader and be able to dualboot if he wants to.


    @j4nn said in the OP that he wants this to be clean and for developers only who can help and general discussion will be found here https://forum.xda-developers.com/xp...devonly-exploits-temp-root-to-backup-t3795510
    1
    @j4nn your work for yoshino exploit is amazing, you have our respect, wish we could relock the BL so that i could sell my xzp with stock features. ?