CVE-2024-32472 excalidraw vulnerable to a Stored XSS in excalidraw's web embed component

Medium 6.1 Published Updated

Attackers can execute arbitrary JavaScript in the context of the Excalidraw editor domain via stored XSS in the web embed component.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-32472?

CVE-2024-32472 is a medium-severity cross-site scripting vulnerability in excalidraw, published on 17 Apr 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

excalidraw is an open source virtual hand-drawn style whiteboard. A stored XSS vulnerability in Excalidraw's web embeddable component. This allows arbitrary JavaScript to be run in the context of the domain where the editor is hosted. There were two vectors. One rendering untrusted string as iframe's `srcdoc` without properly sanitizing against HTML injection. Second by improperly sanitizing against attribute HTML injection. This in conjunction with allowing `allow-same-origin` sandbox flag (necessary for several embeds) resulted in the XSS. This vulnerability is fixed in 0.17.6 and 0.16.4.

Weakness: CWE-80, CWE-79

Which versions are affected by CVE-2024-32472?

4 open source packages ship an affected version, including @excalidraw/excalidraw.

PackageAffectedFixed in
@excalidraw/excalidraw npmFrom 0.16.00.16.4
@excalidraw/excalidraw npmFrom 0.16.00.16.4
@excalidraw/excalidraw npmFrom 0.17.00.17.6
@excalidraw/excalidraw npmFrom 0.17.00.17.6

How do I fix CVE-2024-32472?

Upgrade @excalidraw/excalidraw to a fixed version for your release line: 0.16.4 or 0.17.6.

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-2024-32472 being exploited?

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

Sources

Also known as GHSA-m64q-4jqh-f72f.

Is CVE-2024-32472 in your software?

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

Check your SBOMs for free