Skip to content

Navigation: deeplink start location vulnerability fix#154

Merged
mbarta merged 5 commits intomainfrom
mb/start_location_vulnerability_fix
Jul 22, 2025
Merged

Navigation: deeplink start location vulnerability fix#154
mbarta merged 5 commits intomainfrom
mb/start_location_vulnerability_fix

Conversation

@mbarta
Copy link
Copy Markdown
Collaborator

@mbarta mbarta commented Jul 21, 2025

This PR addresses a vulnerability introduced by the Jetpack Navigation library.

When the navigation graph is created, the Navigation library checks for deep link attributes inside of the Intent's extras. This can be potentially abused to navigate to a location inside of a HotwireWebFragment which is not app's owned domain.

Similar documented case: https://swarm.ptsecurity.com/android-jetpack-navigation-deep-links-handling-exploitation/

The fix is a simple check during navigation graph initialisation which ensures that the host of the deep link start location is the same as host of the NavHost start location set in the Hotwire Native config. If the hosts don't match, navigation to the deep link location is not allowed and is replaced with the start location from config.

@mbarta mbarta requested review from jayohms and jhutarek July 21, 2025 14:36
@mbarta mbarta self-assigned this Jul 21, 2025
Copy link
Copy Markdown
Contributor

@jayohms jayohms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution, and thanks for the tests 👍

@mbarta mbarta merged commit b1da9af into main Jul 22, 2025
1 check passed
@mbarta mbarta deleted the mb/start_location_vulnerability_fix branch July 22, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants