Skip to content

Commit

Permalink
fix(android): prevent implicit PendingIntent vulnerability (#1046)
Browse files Browse the repository at this point in the history
Co-authored-by: Mateus Andrade <15278828+MateusAndrade@users.noreply.github.com>
  • Loading branch information
mussegam and MateusAndrade committed Jul 5, 2021
1 parent c05aec1 commit 7a8dc5f
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -51,6 +51,7 @@ public static IntentSender getSharingSenderIntent(ReactContext reactContext) {

Intent intent = new Intent(sTargetChosenReceiveAction);
intent.setPackage(reactContext.getPackageName());
intent.setClass(reactContext.getApplicationContext(), TargetChosenReceiver.class);
intent.putExtra(EXTRA_RECEIVER_TOKEN, sLastRegisteredReceiver.hashCode());
final PendingIntent callback = PendingIntent.getBroadcast(reactContext, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
Expand Down Expand Up @@ -88,4 +89,4 @@ public static void sendCallback(boolean isSuccess, Object... reply) {
successCallback = null;
failureCallback = null;
}
}
}

0 comments on commit 7a8dc5f

Please sign in to comment.