Uh oh!
There was an error while loading. Please reload this page.
fix(share): Add nonce validation to broadcast receiver on Android - #2592
Open
OS-pedrogustavobilro wants to merge 2 commits into
Open
fix(share): Add nonce validation to broadcast receiver on Android#2592OS-pedrogustavobilro wants to merge 2 commits into
OS-pedrogustavobilro wants to merge 2 commits into
Conversation
Validates nonce to prevent other apps from spoofing the chosen component via exported receiver. References: #2591
OS-pedrogustavobilro
marked this pull request as ready for review
September 7, 2026 17:14
Released dev build of share with dev version: 8.0.2-dev-2592-20260907T172304.0 |
OS-pedrogustavobilro added a commit
to ionic-team/capacitor-testapp
that referenced
this pull request
Sep 7, 2026
OS-pedrogustavobilro
requested review from
ItsChaceD, OS-ruimoreiramendes, andredestro, jcesarmobile, markemer and theproducerSeptember 7, 2026 17:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Validates nonce to prevent other apps from spoofing the chosen component via exported receiver for the share plugin.
Keep
RECEIVER_EXPORTEDbecause Android 14+ requires it for system callbacks viaPendingIntent.fillIn(). Add nonce validation instead: each share request generates a unique UUID included in the callbackPendingIntent. Only broadcasts with a matching nonce are accepted.The system always delivers the same extras that were provided in the
PendingIntent, which is why this solution works.Change Type
Rationale / Problems Fixed
Closes#2591
Tests or Reproductions
You may use the test app from ionic-team/capacitor-testapp#790 to test (may require
--legacy-peer-depsinnpm install).Tested across multiple Android versions (Android 9 to 17), with devices from different manufacturers:
Platforms Affected