A Cross-site Scripting (XSS) vulnerability in Joplin allows an untrusted note opened in safe mode to execute arbitrary code. The `packages/renderer/MarkupToHtml.ts` file renders note content in safe mode without escaping interior HTML tags, enabling an attacker to create a note that closes the opening <pre> tag and includes HTML that runs JavaScript. Since the rendered markdown iframe has the same origin as the top-level document and is not sandboxed, scripts running in the preview iframe can access the top variable and the toplevel NodeJS `require` function, allowing the import of modules like `fs` or `child process` to run arbitrary commands.