CVE-2021-39163: Matrix synapse Adding A Private/unlisted Room To Vulnerability

LOW
Advisory Identifier: GHSA-jj53-8fmw-f2w2
CVSS 3.1
CWE-200
Published
Advisory Summary

CVE-2021-39163 is a LOW (CVSS 3.1) adding a private/unlisted room to vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Matrix synapse libraries in the PyPI ecosystem. The issue involves adding a private/unlisted room to a community exposes room metadata in an unauthorised manner.. Remediation is available by upgrading affected packages to version 1.41.1.

CVE-2021-39163 at a Glance

CVE Identifier CVE-2021-39163
GHSA Identifier GHSA-jj53-8fmw-f2w2
Severity LOW
CVSS v3.1 Base Score 3.1
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Matrix synapse
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N).

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

How to Fix CVE-2021-39163

To remediate this vulnerability, upgrade all affected Matrix synapse 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-synapse fixed: 1.41.1
pip install matrix-synapse>=1.41.1
Verify Direct and Transitive Dependencies

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

pip show matrix-synapse

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2021-39163, inspect your installed packages using pip:

pip show matrix-synapse

Analyze the terminal output to locate any version of Matrix synapse in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.41.1), your application is affected.

Note: The pip show matrix-synapse command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Matrix synapse, 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 Unauthorised users can access the name, avatar, topic and number of members of a room if they know the ID of the room. This vulnerability is limited to homeservers where: - the vulnerable homeserver is in the room; and - untrusted users are permitted to create groups (communities). By default, only homeserver administrators can create groups. However, homeserver administrators can already access this information in the database or using the admin API. As a result, only homeservers where the configuration setting `enable_group_creation` has been set to `true` are impacted. ### Patches Server administrators should upgrade to 1.41.1 or higher. ### Workarounds Server administrators can set `enable_group_creation` to `false` in their homeserver configuration (this is the default value) to prevent creation of groups by non-administrators. Administrators that are using a reverse proxy could, with partial loss of group functionality, block the following endpoints: * `/_matrix/client/r0/groups/{group_id}/rooms` * `/_matrix/client/unstable/groups/{group_id}/rooms` ### References n/a ### For more information If you have any questions or comments about this advisory, e-mail us at security@matrix.org.

CVE-2021-39163 Affected Matrix synapse Versions

1 component(s)
Fixed Versions:
1.41.1
Product / Package Ecosystem Affected Versions Fixed Version
matrix-synapse
PyPI
< 1.41.1
1.41.1

References

Frequently Asked Questions

What is CVE-2021-39163?
CVE-2021-39163 is a security vulnerability in Matrix synapse involving Adding a private/unlisted room to a community exposes room metadata in an unauthorised manner. under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Matrix synapse versions are affected?
Affected versions include releases prior to 1.41.1 across affected packages: matrix-synapse.
What version fixes CVE-2021-39163?
Upgrading to 1.41.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is matrix-synapse affected?
Yes, matrix-synapse is affected in releases prior to 1.41.1. Upgrade your dependency to 1.41.1 or later.
What is the CVSS score of CVE-2021-39163?
CVE-2021-39163 has a CVSS v3.1 base score of 3.1 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2021-39163?
CVE-2021-39163 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check PyPI dependencies for CVE-2021-39163?
Run the dependency tree command: 'pip show matrix-synapse'. 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-jj53-8fmw-f2w2",
  "modified" : "2024-09-24T15:37:56Z",
  "published" : "2021-09-01T18:25:44Z",
  "aliases" : [ "CVE-2021-39163" ],
  "summary" : "Adding a private/unlisted room to a community exposes room metadata in an unauthorised manner.",
  "details" : "### Impact\nUnauthorised users can access the name, avatar, topic and number of members of a room if they know the ID of the room. This vulnerability is limited to homeservers where:\n- the vulnerable homeserver is in the room; and\n- untrusted users are permitted to create groups (communities).\n\nBy default, only homeserver administrators can create groups. However, homeserver administrators can already access this information in the database or using the admin API. As a result, only homeservers where the configuration setting `enable_group_creation` has been set to `true` are impacted.\n\n### Patches\nServer administrators should upgrade to 1.41.1 or higher.\n\n### Workarounds\nServer administrators can set `enable_group_creation` to `false` in their homeserver configuration (this is the default value) to prevent creation of groups by non-administrators.\n\nAdministrators that are using a reverse proxy could, with partial loss of group functionality, block the following endpoints:\n* `/_matrix/client/r0/groups/{group_id}/rooms`\n* `/_matrix/client/unstable/groups/{group_id}/rooms`\n\n### References\nn/a\n\n### For more information\nIf you have any questions or comments about this advisory, e-mail us at security@matrix.org.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "matrix-synapse"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.41.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/security/advisories/GHSA-jj53-8fmw-f2w2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39163"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/commit/cb35df940a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/matrix-org/synapse"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/releases/tag/v1.41.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/matrix-synapse/PYSEC-2021-424.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2VHDEPCZ22GJFMZCWA2XZAGPOEV72POF"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PXT7ID7DNBRN2TVTETU3SYQHJKEG6PXN"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-31T17:46:08Z",
    "nvd_published_at" : "2021-08-31T16:15:00Z"
  }
}