CVE-2025-59160 matrix-js-sdk has insufficient validation when considering a room to be upgraded by another

Low 2.7 Published Updated

Attackers can replace tombstoned rooms with unrelated rooms due to insufficient validation, potentially misleading clients about room history.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-59160?

CVE-2025-59160 is a low-severity vulnerability in matrix-org matrix-js-sdk, published on 16 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Matrix JavaScript SDK is a Matrix Client-Server SDK for JavaScript and TypeScript. matrix-js-sdk before 38.2.0 has insufficient validation of room predecessor links in MatrixClient::getJoinedRooms, allowing a remote attacker to attempt to replace a tombstoned room with an unrelated attacker-supplied room. The issue has been patched and users should upgrade to 38.2.0. A workaround is to avoid using MatrixClient::getJoinedRooms in favor of getRooms() and filtering upgraded rooms separately.

Weakness: CWE-345

Which versions are affected by CVE-2025-59160?

2 open source packages ship an affected version, including matrix-js-sdk.

PackageAffectedFixed in
matrix-js-sdk npmAll versions38.2.0
matrix-js-sdk npmAll versions38.2.0

How do I fix CVE-2025-59160?

Upgrade matrix-js-sdk to 38.2.0 or later.

Is CVE-2025-59160 being exploited?

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

Sources

Also known as DEBIAN-CVE-2025-59160, GHSA-mp7c-m3rh-r56v, UBUNTU-CVE-2025-59160.

Is CVE-2025-59160 in your software?

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

Check your SBOMs for free