Challenges
Search…
Insecure Broadcast Receiver
The activity com.insecureshop.AboutUsActivity is exported and contains the following code:
1
public void onCreate(android.os.Bundle savedInstanceState) {
2
super.onCreate(savedInstanceState);
3
setContentView(2131492892);
4
com.insecureshop.CustomReceiver customReceiver = new com.insecureshop.CustomReceiver();
5
this.receiver = customReceiver;
6
if (customReceiver == null) {
7
kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("receiver");
8
}
9
registerReceiver(customReceiver, new android.content.IntentFilter("com.insecureshop.CUSTOM_INTENT"));
10
}
Copied!
Observe that during onCreate method execution, a receiver is registered. The code highlighted above says the receiver named customReceiver will trigger when the intent filter com.insecureshop.CUSTOM_INTENT is called.
The class com.insecureshop.CustomReceiver contains the following code:
1
public final class CustomReceiver extends android.content.BroadcastReceiver {
2
public void onReceive(android.content.Context context, android.content.Intent intent) {
3
android.os.Bundle extras;
4
java.lang.String stringExtra = (intent == null || (extras = intent.getExtras()) == null) ? null : extras.getString("web_url");
5
java.lang.String str = stringExtra;
6
if (!(str == null || kotlin.text.StringsKt.isBlank(str))) {
7
android.content.Intent intent2 = new android.content.Intent(context, com.insecureshop.WebView2Activity.class);
8
intent2.putExtra("url", stringExtra);
9
if (context != null) {
10
context.startActivity(intent2);
11
}
12
}
13
}
14
}
Copied!
The above code says the onReceive method will be called first which receives the value of web_url from the intent. Its value is further assigned to the variable str. If the value of str is not empty, then this value is passed to the class com.insecureshop.WebView2Activity and is assigned to url as extra.

Exploitation (!!SPOILER!!)

Refer the following video which shows how you can exploit this by creating a third-party android application.
Last modified 4mo ago