CVE-2022-39236: Matrix js sdk Improper Beacon Events Vulnerability

MODERATE
Advisory Identifier: GHSA-hvv8-5v86-r45x
CVSS 4.3
CWE-20
Published
Advisory Summary

CVE-2022-39236 is a MODERATE (CVSS 4.3) improper beacon events vulnerability (CWE-20: Improper Input Validation) affecting Matrix js sdk libraries in the npm ecosystem. The issue involves improper beacon events in matrix-js-sdk can result in availability issues. Remediation is available by upgrading affected packages to version 19.7.0.

CVE-2022-39236 at a Glance

CVE Identifier CVE-2022-39236
GHSA Identifier GHSA-hvv8-5v86-r45x
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-20: Improper Input Validation
Affected Product Matrix js sdk
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.3

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:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2022-39236

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.

matrix-js-sdk fixed: 19.7.0
npm install matrix-js-sdk@19.7.0
Verify Direct and Transitive Dependencies

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-39236, 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.7.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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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

### Impact Improperly formed beacon events (from [MSC3488](https://github.com/matrix-org/matrix-spec-proposals/pull/3488)) can 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. ### Patches This is patched in matrix-js-sdk v19.7.0 ### Workarounds Redacting 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 fix the further perceived issues. Downgrading to an unaffected version, noting that such a version may be subject to other vulnerabilities, will additionally resolve the issue. ### References N/A - This was a logic error in the SDK. ### For more information If you have any questions or comments about this advisory please email us at [security at matrix.org](mailto:security@matrix.org).

CVE-2022-39236 Affected Matrix js sdk Versions

1 component(s)
Fixed Versions:
19.7.0
Product / Package Ecosystem Affected Versions Fixed Version
matrix-js-sdk
npm
≥ 17.1.0-rc.1
< 19.7.0
19.7.0

References

Frequently Asked Questions

What is CVE-2022-39236?
CVE-2022-39236 is a security vulnerability in Matrix js sdk involving Improper beacon events in matrix-js-sdk can result in availability issues under CWE-20: Improper Input Validation.
Which Matrix js sdk versions are affected?
Affected versions include releases prior to 19.7.0 across affected packages: matrix-js-sdk.
What version fixes CVE-2022-39236?
Upgrading to 19.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is matrix-js-sdk affected?
Yes, matrix-js-sdk is affected in releases prior to 19.7.0. Upgrade your dependency to 19.7.0 or later.
What is the CVSS score of CVE-2022-39236?
CVE-2022-39236 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2022-39236?
CVE-2022-39236 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2022-39236?
Run the dependency tree command: 'npm ls matrix-js-sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hvv8-5v86-r45x",
  "modified" : "2022-09-29T14:36:38Z",
  "published" : "2022-09-29T14:36:38Z",
  "aliases" : [ "CVE-2022-39236" ],
  "summary" : "Improper beacon events in matrix-js-sdk can result in availability issues",
  "details" : "### Impact\nImproperly formed beacon events (from [MSC3488](https://github.com/matrix-org/matrix-spec-proposals/pull/3488)) can 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 patched in matrix-js-sdk v19.7.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 fix the further perceived issues.\n\nDowngrading to an unaffected version, noting that such a version may be subject to other vulnerabilities, will additionally resolve the issue.\n\n### References\nN/A - This was a logic error in the SDK.\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:L/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "matrix-js-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "17.1.0-rc.1"
      }, {
        "fixed" : "19.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-hvv8-5v86-r45x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39236"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/matrix-spec-proposals/pull/3488"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/matrix-js-sdk/commit/a587d7c36026fe1fcf93dfff63588abee359be76"
  }, {
    "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.7.0"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202210-35"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-29T14:36:38Z",
    "nvd_published_at" : "2022-09-28T17:15:00Z"
  }
}