CVE-2023-41335: Matrix synapse Matrix-synapse Vulnerable To Temporary Storage Vulnerability

LOW
Advisory Identifier: GHSA-4f74-84v3-j9q5
CVSS 3.7
CWE-312
Published
Advisory Summary

CVE-2023-41335 is a LOW (CVSS 3.7) matrix-synapse vulnerable to temporary storage vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting Matrix synapse libraries in the PyPI ecosystem. The issue involves matrix-synapse vulnerable to temporary storage of plaintext passwords during password changes. Remediation is available by upgrading affected packages to version 1.93.0.

CVE-2023-41335 at a Glance

CVE Identifier CVE-2023-41335
GHSA Identifier GHSA-4f74-84v3-j9q5
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-312: Cleartext Storage of Sensitive Information
Affected Product Matrix synapse
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2023-41335

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.93.0
pip install matrix-synapse>=1.93.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-41335, 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.93.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-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. 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 When users update their passwords, the new credentials may be briefly held in the server database. While this doesn't grant the server any added capabilities—it already learns the users' passwords as part of the authentication process—it does disrupt the expectation that passwords won't be stored in the database. As a result, these passwords could inadvertently be captured in database backups for a longer duration. These temporarily stored passwords are automatically erased after a 48-hour window. ### Patches https://github.com/matrix-org/synapse/pull/16272 ### References This bug was due to a regression in https://github.com/matrix-org/synapse/pull/13188.

CVE-2023-41335 Affected Matrix synapse Versions

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

References

Frequently Asked Questions

What is CVE-2023-41335?
CVE-2023-41335 is a security vulnerability in Matrix synapse involving matrix-synapse vulnerable to temporary storage of plaintext passwords during password changes under CWE-312: Cleartext Storage of Sensitive Information.
Which Matrix synapse versions are affected?
Affected versions include releases prior to 1.93.0 across affected packages: matrix-synapse.
What version fixes CVE-2023-41335?
Upgrading to 1.93.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.93.0. Upgrade your dependency to 1.93.0 or later.
What is the CVSS score of CVE-2023-41335?
CVE-2023-41335 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2023-41335?
CVE-2023-41335 is classified under CWE-312: Cleartext Storage of Sensitive Information (The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere.).
How can I check PyPI dependencies for CVE-2023-41335?
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-4f74-84v3-j9q5",
  "modified" : "2024-09-30T20:42:56Z",
  "published" : "2023-09-26T18:55:24Z",
  "aliases" : [ "CVE-2023-41335" ],
  "summary" : "matrix-synapse vulnerable to temporary storage of plaintext passwords during password changes",
  "details" : "### Impact\n\nWhen users update their passwords, the new credentials may be briefly held in the server database. While this doesn't grant the server any added capabilities—it already learns the users' passwords as part of the authentication process—it does disrupt the expectation that passwords won't be stored in the database. As a result, these passwords could inadvertently be captured in database backups for a longer duration.\n\nThese temporarily stored passwords are automatically erased after a 48-hour window.\n\n### Patches\nhttps://github.com/matrix-org/synapse/pull/16272\n\n### References\n\nThis bug was due to a regression in https://github.com/matrix-org/synapse/pull/13188.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "matrix-synapse"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.66.0"
      }, {
        "fixed" : "1.93.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/security/advisories/GHSA-4f74-84v3-j9q5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41335"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/pull/13188"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/pull/16272"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/commit/69b74d9330e42fc91a9c7423d00a06cd6d3732bf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/matrix-org/synapse"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/matrix-synapse/PYSEC-2023-185.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2AFB2Y3S2VCPCN5P2XCZTG24MBMZ7DM4"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/65QPC55I4D27HIZP7H2NQ34EOXHPP4AO"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/N6P4QULVUE254WI7XF2LWWOGHCYVFXFY"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202401-12"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-312" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-26T18:55:24Z",
    "nvd_published_at" : "2023-09-27T15:19:30Z"
  }
}