CVE-2022-36059: Matrix js sdk Matrix-js-sdk Prototype Pollution Vulnerability Vulnerability
HIGHCVE-2022-36059 is a HIGH (CVSS 7.2) matrix-js-sdk prototype pollution vulnerability vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Matrix js sdk libraries in the npm ecosystem. The issue involves matrix-js-sdk prototype pollution vulnerability. Remediation is available by upgrading affected packages to version 19.4.0.
CVE-2022-36059 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2022-36059
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@19.4.0
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-2022-36059, 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 19.4.0), 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. 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-2022-36059 Affected Matrix js sdk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-js-sdk
|
npm |
< 19.4.0
|
19.4.0
|
References
Frequently Asked Questions
What is CVE-2022-36059?
Which Matrix js sdk versions are affected?
What version fixes CVE-2022-36059?
Is matrix-js-sdk affected?
What is the CVSS score of CVE-2022-36059?
What CWE is associated with CVE-2022-36059?
How can I check npm dependencies for CVE-2022-36059?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rfv9-x7hh-xc32",
"modified" : "2023-03-28T23:09:01Z",
"published" : "2023-03-28T18:59:28Z",
"aliases" : [ "CVE-2022-36059" ],
"summary" : "matrix-js-sdk Prototype Pollution vulnerability",
"details" : "### Impact\nEvents sent with special strings in key places can temporarily disrupt or impede the matrix-js-sdk from functioning properly, potentially impacting the consumer's ability to process data safely. Note that the matrix-js-sdk can appear to be operating normally but be excluding or corrupting runtime data presented to the consumer.\n\n### Patches\nThis is fixed in matrix-js-sdk 19.4.0.\n\n### Workarounds\nRedacting applicable events, waiting for the sync processor to store data, and restarting the client can often fix it. Alternatively, redacting the applicable events and clearing all storage will often fix most perceived issues.\n\nIn some cases, no workarounds are possible.\n\n### References\nhttps://learn.snyk.io/lessons/prototype-pollution/javascript/\n\n### For more information\nIf you have any questions or comments about this advisory please email us at [security at matrix.org](mailto:security@matrix.org).\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-js-sdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "19.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-rfv9-x7hh-xc32"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36059"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-js-sdk"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-js-sdk/releases/tag/v19.4.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-03-28T18:59:28Z",
"nvd_published_at" : "2023-03-28T21:15:00Z"
}
}