CVE-2023-37259 Cross site scripting in Export Chat feature

Medium 6.1 Published Updated

A malicious homeserver can inject scripts into the Export Chat feature, potentially leaking message contents to attackers.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-37259?

CVE-2023-37259 is a medium-severity cross-site scripting vulnerability in matrix-org matrix-react-sdk, published on 18 Jul 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

matrix-react-sdk is a react-based SDK for inserting a Matrix chat/voip client into a web page. The Export Chat feature includes certain attacker-controlled elements in the generated document without sufficient escaping, leading to stored Cross site scripting (XSS). Since the Export Chat feature generates a separate document, an attacker can only inject code run from the `null` origin, restricting the impact. However, the attacker can still potentially use the XSS to leak message contents. A malicious homeserver is a potential attacker since the affected inputs are controllable server-side. This issue has been addressed in commit `22fcd34c60` which is included in release version 3.76.0. Users are advised to upgrade. The only known workaround for this issue is to disable or to not use the Export Chat feature.

Weakness: CWE-79

Which versions are affected by CVE-2023-37259?

2 open source packages ship an affected version, including matrix-react-sdk. It affects 1 product.

PackageAffectedFixed in
matrix-react-sdk npmFrom 3.32.03.76.0
matrix-react-sdk npmFrom 3.32.03.76.0
Linux distribution packages (2)
element-desktop openSUSE:TumbleweedAll versions1.11.36-1.1
element-web openSUSE:TumbleweedAll versions1.11.36-1.1

Products include Matrix-React-Sdk Project Matrix-React-Sdk.

How do I fix CVE-2023-37259?

Upgrade matrix-react-sdk to 3.76.0 or later.

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-37259 being exploited?

There is no known exploitation of CVE-2023-37259 in the wild and no public exploit code.

Sources

Also known as GHSA-c9vx-2g7w-rp65, openSUSE-SU-2024:13054-1, openSUSE-SU-2024:13055-1.

Is CVE-2023-37259 in your software?

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

Check your SBOMs for free