CVE-2023-32683: Matrix synapse Synapse Has URL Deny List Vulnerability

MODERATE
Advisory Identifier: GHSA-98px-6486-j7qc
CVSS 3.5
CWE-918 CWE-863
Published
Advisory Summary

CVE-2023-32683 is a MODERATE (CVSS 3.5) synapse has url deny list vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Matrix synapse libraries in the PyPI ecosystem. The issue involves synapse has url deny list bypass via oembed and image urls when generating previews. Remediation is available by upgrading affected packages to version 1.85.0.

CVE-2023-32683 at a Glance

CVE Identifier CVE-2023-32683
GHSA Identifier GHSA-98px-6486-j7qc
Severity MODERATE
CVSS v3.1 Base Score 3.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Matrix synapse
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.5

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

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

How to Fix CVE-2023-32683

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-32683, 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. 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 A discovered oEmbed or image URL can bypass the `url_preview_url_blacklist` setting potentially allowing server side request forgery or bypassing network policies. Impact is limited to IP addresses allowed by the `url_preview_ip_range_blacklist` setting (by default this only allows public IPs) and by the limited information returned to the client: * For discovered oEmbed URLs, any non-JSON response or a JSON response which includes non-oEmbed information is discarded. * For discovered image URLs, any non-image response is discarded. Systems which have URL preview disabled (via the `url_preview_enabled` setting) or have not configured a `url_preview_url_blacklist` are not affected. Because of the uncommon configuration required, the limited information a malicious user, and the amount of guesses/time the attack would need; the severity is rated as low. ### Patches The issue is fixed by #15601. ### Workarounds The default configuration of the `url_preview_ip_range_blacklist` should protect against requests being made to internal infrastructure, URL previews of public URLs is expected. Alternately URL previews could be disabled using the `url_preview_enabled` setting.

CVE-2023-32683 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-32683?
CVE-2023-32683 is a security vulnerability in Matrix synapse involving Synapse has URL deny list bypass via oEmbed and image URLs when generating previews under CWE-918: Server-Side Request Forgery (SSRF).
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-32683?
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-32683?
CVE-2023-32683 has a CVSS v3.1 base score of 3.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2023-32683?
CVE-2023-32683 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2023-32683?
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-98px-6486-j7qc",
  "modified" : "2024-09-30T20:34:41Z",
  "published" : "2023-06-06T16:41:34Z",
  "aliases" : [ "CVE-2023-32683" ],
  "summary" : "Synapse has URL deny list bypass via oEmbed and image URLs when generating previews",
  "details" : "### Impact\nA discovered oEmbed or image URL can bypass the `url_preview_url_blacklist` setting potentially allowing server side request forgery or bypassing network policies. Impact is limited to IP addresses allowed by the `url_preview_ip_range_blacklist` setting (by default this only allows public IPs) and by the limited information returned to the client:\n\n* For discovered oEmbed URLs, any non-JSON response or a JSON response which includes non-oEmbed information is discarded.\n* For discovered image URLs, any non-image response is discarded.\n\nSystems which have URL preview disabled (via the `url_preview_enabled` setting) or have not configured a `url_preview_url_blacklist` are not affected.\n\nBecause of the uncommon configuration required, the limited information a malicious user, and the amount of guesses/time the attack would need; the severity is rated as low.\n\n### Patches\n\nThe issue is fixed by #15601.\n\n### Workarounds\n\nThe default configuration of the `url_preview_ip_range_blacklist` should protect against requests being made to internal infrastructure, URL previews of public URLs is expected.\n\nAlternately URL previews could be disabled using the `url_preview_enabled` setting.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/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-98px-6486-j7qc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-32683"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/synapse/pull/15601"
  }, {
    "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-85.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/X6DH5A5YEB5LRIPP32OUW25FCGZFCZU2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863", "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-06T16:41:34Z",
    "nvd_published_at" : "2023-06-06T19:15:11Z"
  }
}