CVE-2023-37898 Safe mode Cross-site Scripting (XSS) vulnerability in Joplin

High 8.2 Published Updated

An XSS vulnerability in Joplin's safe mode allows attackers to execute arbitrary code via crafted notes, potentially compromising the local system.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2023-37898?

CVE-2023-37898 is a high-severity cross-site scripting vulnerability in laurent22 joplin, published on 21 Jun 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

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. `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 has been addressed in version 2.12.9 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-79

Which versions are affected by CVE-2023-37898?

It affects 1 product.

Products include Joplin Project Joplin.

How do I fix CVE-2023-37898?

No fix has been published for CVE-2023-37898 yet. Limit exposure of the affected software until one is available.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2023-37898 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-37898 exists.

Sources

Also known as GHSA-hjmq-3qh4-g2r8.

Is CVE-2023-37898 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free