Skip to content

Commit 52c2cf7

Browse files
committed
Add documentation for deep link intent validation
1 parent 2484b61 commit 52c2cf7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

navigation-fragments/src/main/java/dev/hotwire/navigation/navigator/NavigatorHost.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ open class NavigatorHost : NavHostFragment(), FragmentOnAttachListener {
7171
}
7272
}
7373

74+
/**
75+
* Google's Navigation library automatically navigates to deep links provided in the
76+
* Activity's Intent. This exposes a vulnerability for malicious Intents to open an arbitrary
77+
* webpage outside of the app's domain, allowing javascript injection on the page. Ensure
78+
* that deep link intents always match the app's domain.
79+
*/
7480
@VisibleForTesting(otherwise = PROTECTED)
7581
fun ensureDeeplinkStartLocationValid() {
7682
val extrasBundle = activity.intent.extras?.getBundle(DEEPLINK_EXTRAS_KEY) ?: return

0 commit comments

Comments
 (0)