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

<script> in the md file fetched from the basePath is not executed #1659

Open
1 task
b6pzeusbc54tvhw5jgpyw8pwz2x6gs opened this issue Nov 3, 2021 · 0 comments

Comments

@b6pzeusbc54tvhw5jgpyw8pwz2x6gs
Copy link

b6pzeusbc54tvhw5jgpyw8pwz2x6gs commented Nov 3, 2021

Bug Report

<script>// my script</script> in md file from basePath is not executed.

Steps to reproduce

  • Provide the basePath as a full url with a domain different from the domain of index.html.
  • open url of index.html with your browser.
  • When you fetch the md files from basePath, you can check that the script in the md file cannot be executed.

What is current behaviour

In this case, the value of isRemoteUrl is determined to be true, so the <script> code is sanitized by the code below.

html = this.isRemoteUrl
? DOMPurify.sanitize(html, { ADD_TAGS: ['script'] })
: html;

What is the expected behaviour

basePath is a value that can be entered only with the authority of the document site administrator, and the basePath server can also be considered owned by the administrator, so the isRemoteUrl value should be false.

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: macOS 11

  • Node.js version:

  • npm/yarn version:

  • Browser version:

  • Docsify version: 4.12.1

  • Docsify plugins:

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