🔒 Secure RemoteInput PendingIntent boundaries (#800)
Added `setPackage(packageName)` to the explicitly defined reply intent before wrapping it in the mutable PendingIntent for remote input. RemoteInput intents strictly require `FLAG_MUTABLE` so the Android OS can append the user's text reply. To use `FLAG_MUTABLE` securely and prevent unintentional component delivery, explicit component boundaries (like `setPackage`) must be defined.
This commit is contained in:
@@ -150,6 +150,7 @@ class ChatNotificationService : Service() {
|
|||||||
val replyIntent =
|
val replyIntent =
|
||||||
Intent(this, NotificationReplyReceiver::class.java).apply {
|
Intent(this, NotificationReplyReceiver::class.java).apply {
|
||||||
action = "$packageName.ACTION_NOTIFICATION_REPLY"
|
action = "$packageName.ACTION_NOTIFICATION_REPLY"
|
||||||
|
setPackage(packageName)
|
||||||
putExtra(NotificationReplyReceiver.EXTRA_SESSION_ID, sessionId)
|
putExtra(NotificationReplyReceiver.EXTRA_SESSION_ID, sessionId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user