CVE-2025-59160: matrix-js-sdk has insufficient validation when considering a room to be upgraded by another
Impact 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. Patches The issue has been patched and users should upgrade to 38.2.0. Workarounds Avoid using MatrixClient::getJoinedRooms in favour of getRooms() and filtering upgraded rooms separately.
Published Sep 16, 2025 · Updated Sep 22, 2025
Affected packages
matrix-js-sdk
- Ecosystem
- npm
- Affected
- < 38.2.0
- Fixed in
- 38.2.0
- Check
npm ls matrix-js-sdk
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
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.
Patches
The issue has been patched and users should upgrade to 38.2.0.
Workarounds
Avoid using MatrixClient::getJoinedRooms in favour of getRooms() and filtering upgraded rooms separately.
Credited to cai0duque.
References
- https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-mp7c-m3rh-r56v
- https://nvd.nist.gov/vuln/detail/CVE-2025-59160
- https://github.com/matrix-org/matrix-js-sdk/commit/43c72d5bf5e2d0a26b3b4f71092e7cb39d4137c4
- https://github.com/matrix-org/matrix-js-sdk/releases/tag/v38.2.0
- https://www.npmjs.com/package/matrix-js-sdk/v/38.2.0
- https://github.com/advisories/GHSA-mp7c-m3rh-r56v
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2024-50336
matrix-js-sdk has insufficient MXC URI validation which allows client-side path traversal
medium5.3Nov 12, 2024CVE-2024-47080
Matrix JavaScript SDK's key history sharing could share keys to malicious devices
high8.7Oct 15, 2024CVE-2024-42369
matrix-js-sdk will freeze when a user sets a room with itself as a its predecessor
medium4.1Aug 20, 2024
