CVE-2023-32682: Matrix synapse Synapse Has Improper Checks For Vulnerability

MODERATE
Advisory Identifier: GHSA-26c5-ppr8-f33p
CVSS 5.4
CWE-287
Published
Advisory Summary

CVE-2023-32682 is a MODERATE (CVSS 5.4) synapse has improper checks for vulnerability (CWE-287: Improper Authentication) affecting Matrix synapse libraries in the PyPI ecosystem. The issue involves synapse has improper checks for deactivated users during login. Remediation is available by upgrading affected packages to version 1.85.0.

CVE-2023-32682 at a Glance

CVE Identifier CVE-2023-32682
GHSA Identifier GHSA-26c5-ppr8-f33p
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-287: Improper Authentication
Affected Product Matrix synapse
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.4

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

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 Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-32682

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.85.0
pip install matrix-synapse>=1.85.0
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-2023-32682, 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.85.0), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. 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 It may be possible for a deactivated user to login when using uncommon configurations. This only applies if any of the following are true: * [JSON Web Tokens are enabled for login](https://matrix-org.github.io/synapse/latest/jwt.html) via the `jwt_config.enabled` configuration setting * The [local password database is enabled](https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#password_config) via the `password_config.enabled` and `password_config.localdb_enabled` configuration settings *and* a user's password is [updated via an admin API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#create-or-modify-account) after a user is deactivated. **Note that the local password database is enabled by default**, but it is uncommon to set a user's password after they've been deactivated. Installations that are configured to only allow login via Single Sign-On (SSO) via CAS, SAML or OpenID Connect (OIDC); or via an external password provider (e.g. LDAP) are not affected. ### Patches * If using JSON Web Token logins: #15624 * For other users: #15634 ### Workarounds If not using JSON Web Tokens, ensure that deactivated users do not have a password set. This list of users can be queried from PostgreSQL: ```sql SELECT name FROM users WHERE password_hash IS NOT NULL AND deactivated = 1; ```

CVE-2023-32682 Affected Matrix synapse Versions

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

References

Frequently Asked Questions

What is CVE-2023-32682?
CVE-2023-32682 is a security vulnerability in Matrix synapse involving Synapse has improper checks for deactivated users during login under CWE-287: Improper Authentication.
Which Matrix synapse versions are affected?
Affected versions include releases prior to 1.85.0 across affected packages: matrix-synapse.
What version fixes CVE-2023-32682?
Upgrading to 1.85.0 (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.85.0. Upgrade your dependency to 1.85.0 or later.
What is the CVSS score of CVE-2023-32682?
CVE-2023-32682 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2023-32682?
CVE-2023-32682 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check PyPI dependencies for CVE-2023-32682?
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-26c5-ppr8-f33p",
  "modified" : "2024-09-24T17:36:26Z",
  "published" : "2023-06-06T16:40:42Z",
  "aliases" : [ "CVE-2023-32682" ],
  "summary" : "Synapse has improper checks for deactivated users during login",
  "details" : "### Impact\nIt may be possible for a deactivated user to login when using uncommon configurations.\n\nThis only applies if any of the following are true:\n\n* [JSON Web Tokens are enabled for login](https://matrix-org.github.io/synapse/latest/jwt.html) via the `jwt_config.enabled` configuration setting\n* The [local password database is enabled](https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#password_config) via the `password_config.enabled` and `password_config.localdb_enabled` configuration settings *and* a user's password is [updated via an admin API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#create-or-modify-account) after a user is deactivated.\n\n**Note that the local password database is enabled by default**, but it is uncommon to set a user's password after they've been deactivated.\n\nInstallations that are configured to only allow login via Single Sign-On (SSO) via CAS, SAML or OpenID Connect (OIDC); or via an external password provider (e.g. LDAP) are not affected.\n\n### Patches\n\n* If using JSON Web Token logins: #15624\n* For other users: #15634\n\n### Workarounds\n\nIf not using JSON Web Tokens, ensure that deactivated users do not have a password set. This list of users can be queried from PostgreSQL:\n\n```sql\nSELECT name FROM users WHERE password_hash IS NOT NULL AND deactivated = 1;\n```\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "matrix-synapse"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.85.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/security/advisories/GHSA-26c5-ppr8-f33p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-32682"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/issues/12274"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/pull/15624"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/pull/15634"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/matrix-org/synapse"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/releases/tag/v1.85.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/matrix-synapse/PYSEC-2023-84.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/X6DH5A5YEB5LRIPP32OUW25FCGZFCZU2"
  }, {
    "type" : "WEB",
    "url" : "https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#create-or-modify-account"
  }, {
    "type" : "WEB",
    "url" : "https://matrix-org.github.io/synapse/latest/jwt.html"
  }, {
    "type" : "WEB",
    "url" : "https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#password_config"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-06T16:40:42Z",
    "nvd_published_at" : "2023-06-06T19:15:11Z"
  }
}