Skip to content

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

Open
@b6pzeusbc54tvhw5jgpyw8pwz2x6gs

Description

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy