Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][Security] Markdown does not have any URI scheme restrictions #5195

Open
stypr opened this issue Apr 23, 2024 · 0 comments
Open

[Bug][Security] Markdown does not have any URI scheme restrictions #5195

stypr opened this issue Apr 23, 2024 · 0 comments

Comments

@stypr
Copy link

stypr commented Apr 23, 2024

Bug Description

There doesn't seem to be a URI scheme validation when the URL is already set on the link.
This makes it possible for attackers to make a malicious link that can open any kinds of URI on the client side, including any executables, deeplinks and files on the directory.
As a result, an attacker can maliciously craft a payload to harm other users by leaving a link on the page.

It may not sound exploitable at all, but if the victim's system has an application that has a vulnerability in the deeplink implementation, this issue can be leveraged to execute an arbitrary code execution.

How to Reproduce

Opening cmd.exe

  1. Create a new document with the following text
[Click Me](file:///C:\Windows\System32\calc.exe)
  1. Convert it to the link -- You can remove ) and readd ) to make it to a link

  2. Click on a link, Open link

  3. Confirm that cmd is opened

image

Other possible deeplinks

[deeplink1](appflowy-flutter://#access_token=1234&refresh_token=1234)
[deeplink2](AppFlowy://12341234)
[deeplink3](calculator://1)

Expected Behavior

URL needs to be validated and needs to print Incorrect Link.

Operating System

Windows 11 x86_64

AppFlowy Version(s)

0.5.4

Screenshots

No response

Additional Context

No response

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

No branches or pull requests

1 participant