Skip to content

prevent malicious javascript execution in url_launcher_extension.dart#1193

Closed
mateea326 wants to merge 1 commit intoAppFlowy-IO:mainfrom
mateea326:main
Closed

prevent malicious javascript execution in url_launcher_extension.dart#1193
mateea326 wants to merge 1 commit intoAppFlowy-IO:mainfrom
mateea326:main

Conversation

@mateea326
Copy link
Copy Markdown

fix(core): prevent malicious javascript execution in url_launcher

Description

This PR addresses a Cross-Site Scripting (XSS) vulnerability. Previously, safeLaunchUrl and afLaunchUrl passed URIs directly to the url_launcher plugin without scheme validation. On Flutter Web, this allows the execution of javascript: URIs.

This change introduces a strict whitelist of safe URI schemes (http, https, mailto, tel, sms) to block the execution of dangerous payloads.

Changes

  • Add URI scheme whitelist to appflowy_flutter's url_launcher.dart wrapper.
  • Add URI scheme whitelist to appflowy-editor's url_launcher_extension.dart wrapper.

Testing

  • Verified that clicking a markdown link like [XSS](javascript:alert("xss")) no longer executes on the Web platform.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 30, 2026

CLA assistant check
All committers have signed the CLA.

@mateea326 mateea326 closed this by deleting the head repository Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants