Skip to main content

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

CVE-2023-37898

Severity Medium
Score 5.4/10

Summary

Joplin is a free, open-source note-taking and to-do application. A Cross-site Scripting (XSS) vulnerability allows an untrusted note opened in safe mode to execute arbitrary code. The `packages/renderer/MarkupToHtml.ts` renders note content in safe mode by surrounding it with `<pre>` and `</pre>`, without escaping any interior HTML tags. Thus, an attacker can create a note that closes the opening `<pre>` tag, then includes HTML that runs JavaScript. Because the rendered markdown `iframe` has the same origin as the toplevel document and is not sandboxed, any scripts running in the preview `iframe` can access the `top` variable and, thus, access the toplevel NodeJS `require` function. `require` can then be used to import modules like `fs` or `child_process` and run arbitrary commands. This issue affects versions prior to 2.12.1.

  • LOW
  • NETWORK
  • LOW
  • CHANGED
  • REQUIRED
  • LOW
  • LOW
  • NONE

CWE-79 - Cross Site Scripting

Cross-Site Scripting, commonly referred to as XSS, is the most dominant class of vulnerabilities. It allows an attacker to inject malicious code into a pregnable web application and victimize its users. The exploitation of such a weakness can cause severe issues such as account takeover, and sensitive data exfiltration. Because of the prevalence of XSS vulnerabilities and their high rate of exploitation, it has remained in the OWASP top 10 vulnerabilities for years.

Advisory Timeline

  • Published