Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] Guard ente-auth deep link parsing against malformed URIs

Benedikt Koeppel17ee46b06077
diff --git a/mobile/apps/auth/lib/ui/home_page.dart b/mobile/apps/auth/lib/ui/home_page.dart
index 019774e665..ce67c5f1d1 100644
--- a/mobile/apps/auth/lib/ui/home_page.dart
+++ b/mobile/apps/auth/lib/ui/home_page.dart
@@ -1914,14 +1914,18 @@ class _HomePageState extends State<HomePage> {
lastScanTime = DateTime.now().millisecondsSinceEpoch;
final lowerLink = link.toLowerCase();
if (mounted && (lowerLink.startsWith("ente-auth://") || lowerLink.startsWith("enteauth://"))) {
- final uri = Uri.parse(link);
- if (uri.host != "search") return;
- final searchQuery = uri.queryParameters['query'];
- if (searchQuery != null && searchQuery.isNotEmpty) {
- _showSearchBox = true;
- _textController.text = searchQuery;
- _searchText = searchQuery;
- _applyFilteringAndRefresh();
+ try {
+ final uri = Uri.parse(link);
+ if (uri.host != "search") return;
+ final searchQuery = uri.queryParameters['query'];
+ if (searchQuery != null && searchQuery.isNotEmpty) {
+ _showSearchBox = true;
+ _textController.text = searchQuery;
+ _searchText = searchQuery;
+ _applyFilteringAndRefresh();
+ }
+ } catch (e) {
+ _logger.warning("Malformed ente-auth deep link: $link", e);
}
} else if (mounted && lowerLink.startsWith("otpauth://")) {
try {