Joplin ElectronJS based Client: from XSS to RCE
The Joplin note-taking app rendered Markdown with HTML enabled in a WebView that lacked context isolation, so an attacker could inject JavaScript that overrode a function called by the privileged main process, leading to arbitrary code execution. A malicious note could be delivered via synchronisation, and the vulnerability was fixed in version 1.0.109.
blog.devsecurity.eu
Published on blog.devsecurity.eu
One day I was reading the master’s thesis “Analysis of Electron-Based Applications…” by Silvia Väli. She basically applied the auditing checklist by Luca Carettoni, searched GitHub projects for some interesting keywords and then manually reviewed and tested for vulnerabilities.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the WebView used to render Markdown had Node.js integration disabled but context isolation was not enabled, allowing JavaScript in the note to override built-in functions that the privileged main process later called.
Impact
An attacker could execute arbitrary code on the victim's machine by delivering a malicious note, for example through synchronisation with cloud storage or network shares, though the attacker would need to compromise the storage credentials first in that case.
What the attacker needed
Victim opens a malicious note; attacker can deliver note via sync (e.g., cloud storage)
The fix
The issue was fixed by enabling context isolation and adjusting inter-process communication in version 1.0.109.
How it was found
- Put a crafted payload into the Markdown editor.
- The payload overrides Function.prototype.call to execute a command when the main process calls it.
- Reload the page to trigger the privileged call.
- A calculator pops up, demonstrating code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Joplin is a note-taking app built with Electron, a framework that lets web pages run desktop programs. The app displayed notes as web pages but didn't fully separate the web page from the powerful desktop part. An attacker could put a special note in the app that, when opened, ran commands on the user's computer.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.