CVE-2022-39200: Github.com/matrix org/dendrite Dendrite Signature Checks Not Applied Vulnerability

HIGH
Advisory Identifier: GHSA-pfw4-xjgm-267c
CVSS 7.3
CWE-347
Published
Advisory Summary

CVE-2022-39200 is a HIGH (CVSS 7.3) dendrite signature checks not applied vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Github.com/matrix org/dendrite libraries in the Go ecosystem. The issue involves dendrite signature checks not applied to some retrieved missing events. Remediation is available by upgrading affected packages to version 0.9.8.

CVE-2022-39200 at a Glance

CVE Identifier CVE-2022-39200
GHSA Identifier GHSA-pfw4-xjgm-267c
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Github.com/matrix org/dendrite
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.3

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

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

How to Fix CVE-2022-39200

To remediate this vulnerability, upgrade all affected Github.com/matrix org/dendrite dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/matrix-org/dendrite fixed: 0.9.8
Upgrade github.com/matrix-org/dendrite to 0.9.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/matrix-org/dendrite

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-39200, inspect your project dependencies for Github.com/matrix org/dendrite:

inspect dependencies for github.com/matrix-org/dendrite

Analyze the terminal output to locate any version of Github.com/matrix org/dendrite in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Github.com/matrix org/dendrite, 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 Events retrieved from a remote homeserver using `/get_missing_events` did not have their signatures verified correctly. This could potentially allow a remote homeserver to provide invalid/modified events to Dendrite via this endpoint. Note that this does not apply to events retrieved through other endpoints (e.g. `/event`, `/state`) as they have been correctly verified. Homeservers that have federation disabled are not vulnerable. ### Patches The problem has been fixed in Dendrite 0.9.8. ### Workarounds There are no workarounds. ### Special thanks Tulir Asokan, who spotted the issue originally.

CVE-2022-39200 Affected Github.com/matrix org/dendrite Versions

1 component(s)
Fixed Versions:
0.9.8
Product / Package Ecosystem Affected Versions Fixed Version
github.com/matrix-org/dendrite
Go
< 0.9.8
0.9.8

References

Frequently Asked Questions

What is CVE-2022-39200?
CVE-2022-39200 is a security vulnerability in Github.com/matrix org/dendrite involving Dendrite signature checks not applied to some retrieved missing events under CWE-347: Improper Verification of Cryptographic Signature.
Which Github.com/matrix org/dendrite versions are affected?
Affected versions include releases prior to 0.9.8 across affected packages: github.com/matrix-org/dendrite.
What version fixes CVE-2022-39200?
Upgrading to 0.9.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/matrix-org/dendrite affected?
Yes, github.com/matrix-org/dendrite is affected in releases prior to 0.9.8. Upgrade your dependency to 0.9.8 or later.
What is the CVSS score of CVE-2022-39200?
CVE-2022-39200 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2022-39200?
CVE-2022-39200 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check Go dependencies for CVE-2022-39200?
Run the dependency tree command: 'inspect dependencies for github.com/matrix-org/dendrite'. 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-pfw4-xjgm-267c",
  "modified" : "2022-09-15T03:28:01Z",
  "published" : "2022-09-15T03:28:01Z",
  "aliases" : [ "CVE-2022-39200" ],
  "summary" : "Dendrite signature checks not applied to some retrieved missing events",
  "details" : "### Impact\n\nEvents retrieved from a remote homeserver using `/get_missing_events` did not have their signatures verified correctly. This could potentially allow a remote homeserver to provide invalid/modified events to Dendrite via this endpoint.\n\nNote that this does not apply to events retrieved through other endpoints (e.g. `/event`, `/state`) as they have been correctly verified.\n\nHomeservers that have federation disabled are not vulnerable.\n\n### Patches\n\nThe problem has been fixed in Dendrite 0.9.8.\n\n### Workarounds\n\nThere are no workarounds.\n\n### Special thanks\n\nTulir Asokan, who spotted the issue originally.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/matrix-org/dendrite"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/dendrite/security/advisories/GHSA-pfw4-xjgm-267c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39200"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/dendrite/commit/2792d0490f3771488bad346981b8c26479a872c3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/matrix-org/dendrite"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-15T03:28:01Z",
    "nvd_published_at" : "2022-09-12T20:15:00Z"
  }
}