CVE-2024-42369: Matrix js sdk Matrix-js-sdk Will Freeze When A Vulnerability
MODERATECVE-2024-42369 is a MODERATE (CVSS 4.1) matrix-js-sdk will freeze when a vulnerability (CWE-674: Uncontrolled Recursion) affecting Matrix js sdk libraries in the npm ecosystem. The issue involves matrix-js-sdk will freeze when a user sets a room with itself as a its predecessor. Remediation is available by upgrading affected packages to version 34.3.1.
CVE-2024-42369 at a Glance
Security Impact
CVSS: 4.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:L).
How to Fix CVE-2024-42369
To remediate this vulnerability, upgrade all affected Matrix js sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install matrix-js-sdk@34.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls matrix-js-sdk
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-42369, inspect your project dependencies using npm:
npm ls matrix-js-sdk
Analyze the terminal output to locate any version of Matrix js sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 34.3.1), your application is affected.
Note: The npm ls matrix-js-sdk command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. In Matrix js sdk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-42369 Affected Matrix js sdk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-js-sdk
|
npm |
< 34.3.1
|
34.3.1
|
References
Frequently Asked Questions
What is CVE-2024-42369?
Which Matrix js sdk versions are affected?
What version fixes CVE-2024-42369?
Is matrix-js-sdk affected?
What is the CVSS score of CVE-2024-42369?
What CWE is associated with CVE-2024-42369?
How can I check npm dependencies for CVE-2024-42369?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vhr5-g3pm-49fm",
"modified" : "2024-08-20T18:35:28Z",
"published" : "2024-08-20T18:35:27Z",
"aliases" : [ "CVE-2024-42369" ],
"summary" : "matrix-js-sdk will freeze when a user sets a room with itself as a its predecessor",
"details" : "### Impact\nA 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.\n\nEven if the CVSS score would be 4.1 ([AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:L](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:L&version=3.1)) we classify this as High severity issue.\n\n### Patches\nThis was patched in matrix-js-sdk 34.3.1.\n\n### Workarounds\nSanity check rooms before passing them to the matrix-js-sdk or avoid calling either `getRoomUpgradeHistory` or `leaveRoomChain`.\n\n### References\nN/A.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:N/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-js-sdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "34.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-vhr5-g3pm-49fm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-42369"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-js-sdk/commit/a0efed8b881b3db6c9f2c71d6a6e74c2828978c6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-js-sdk"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-674" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-20T18:35:27Z",
"nvd_published_at" : "2024-08-20T15:15:21Z"
}
}