Member-only story
Bypass Jailbreak Detection in Flutter apps
If you ever worked on a mobile Flutter application for a big company, or if you ever needed to treat your users’ personal data carefully, you may consider securing your Flutter app in some way.
During the last Flutter Forward on Wednesday, January 25, a place in the “on-demand sessions” has been reserved for an interesting video from Majid Hajian about “Securing Flutter Apps | OWASP Top 10 for mobile & RASP explained”.
You should check it out as a good introduction to OWASP Foundation and the Runtime Application Self Protection (RASP) solutions.
A big point is touched on when it comes to mobile security in general: an app’s ability to understand if the device on which it is running has been rooted or jailbroken.
This article will focus on iOS and the so-called jailbreak detection.
Notice that, although in detail, the information that you are going to learn, has an informative purpose only and you should try those technics on apps that you own or on which you have permission to do those kinds of checks.
I will use a simple Flutter project specifically made for this purpose, using two Flutter packages, flutter_jailbreak_detection, and freeRASP.
- Setup
- Different kinds of Jailbreak Detection
- Flutter packages
- Technics
- Conclusion
Setup
In order to start testing, you need:
- an iOS app
- Hopper Disassembler
- a Jailbroken iPhone (not totally true, more on that later)
iOS app
You can build your own .ipa file with flutter build ipa command, you can run flutter build ios — release to make a .app file or you could also grab an application from a Jailbroken iPhone. Whatever method you want to use it’s up to you (and what you can do at the time of testing).
If you have a .ipa file, just change the extension to .zip and decompress it. It should reveal a folder named Payload with a…