Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions frontend/appflowy_flutter/lib/core/helpers/url_launcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ Future<bool> afLaunchUri(
);
}

// Security: Prevent execution of dangerous URI schemes (XSS)
final validSchemes = ['http', 'https', 'mailto', 'tel', 'sms'];
if (uri.scheme.isNotEmpty && !validSchemes.contains(uri.scheme.toLowerCase())) {
Log.error('Blocked attempt to launch unsafe URI scheme: ${uri.scheme}');
return false;
}


// on Linux or Android or Windows, add http scheme to the url if it is not present
if ((UniversalPlatform.isLinux ||
UniversalPlatform.isAndroid ||
Expand Down
Loading