This is a PoC demonstrating how to perform OAuth Mobile App Impersonation through custom scheme hijacking as described in Ostorlab Blog. This can be used to demonstrate the vulnerability by creating a malicious app that impersonates a legitimate app by registering a custom scheme that is similar to the legitimate app's scheme. The registered custom scheme can then be used to listen for OAuth codes that are sent via redirect_uri
.
- Flutter installed on your machine
- Clone the repository
- Install the dependencies by running
flutter pub get
- Search for "schemeName" in the project and replace it with the custom scheme of the target app (ex:
com.example.app
) - Fill the
oauthurl
variable inmain.dart
with the OAuth URL of the target app - Run the app using
flutter run