Critical

Sydent does not verify email server certificates

  • Disclosed: 31.07.2023
  • Updated: 11.10.2026 15:17

Impact

If configured to send emails using TLS, Sydent does not verify SMTP servers' certificates. This makes Sydent's emails vulnerable to interception via a man-in-the-middle (MITM) attack. Attackers with privileged access to the network can intercept room invitations and address confirmation emails.

CVSS 3.1 overall score: 3.3 - AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N/CR:L/IR:L/AR:X/MAV:A/MAC:H/MPR:N/MUI:N/MS:C/MC:L/MI:L/MA:N

Reported by Martin Schobert, Pentagrid AG.

Details

Sydent can be configured to send emails over a TLS-encrypted socket by setting

yaml
email:
    tlsmode: "TLS"  # or the legacy value "SSL"

in its config file. Alternatively it can be configured to use Opportunistic TLS by setting

yaml
email:
    tlsmode: "STARTTLS"

In both situations, Sydent will encrypt its communication with the SMTP server when sending emails. In affected versions, Sydent will not verify the destination server's certificate.

Vulnerability

Sydent sends email for two purposes:

  • to inform a third party that they have been invited to a Matrix room by their email address; and
  • to verify that a given Matrix user controls an email address.

Therefore, attackers capable of running a MITM attack can

  1. Intercept room invitations sent to an email address. The invitation includes
    • the room ID and its avatar, and
    • the inviter's username, displayname and their avatar, and
    • credentials for a guest Matrix account on the inviter's homeserver.
  2. Intercept address ownership confirmation emails. This would allow the attacker to falsely claim ownership of the indented recipient's Matrix account, if that account was permitted to log in using an email address and no other authentication factors.

Patches

This is patched in Sydent 2.5.6, see PR https://github.com/matrix-org/sydent/pull/574.

When patching, make sure that Sydent trusts the certificate of the server it is connecting to. This should happen automatically when using properly issued certificates. If you are using self-signed certificates, make sure to copy your Certification Authority certificate, or your self signed certificate if using only one, to the trust store of your operating system.

Workarounds

One can ensure Sydent's emails fail to send by setting the configured SMTP server to a loopback or non-routable address under your control which does not have a listening SMTP server. For example:

yaml
email:
    smtphost: "localhost"  # Assuming there is no SMTP server listening on localhost

References

For more information

If you have any questions or comments about this advisory, e-mail us at security@matrix.org.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) matrix-sydent < 2.5.6 2.5.6

References

CVSS score 9.3/10
CVSS vector
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
Weakness (CWE)
CWE-295
Platform
Python (PyPI)
Package
matrix-sydent
Disclosed
31.07.2023
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2023-139 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-p6hw-wm59-3g5g - CC BY 4.0

Vulnerability history: matrix-sydent

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
7
First → latest
05.2019 07.2023
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 2
  • Medium 4

Disclosures per year

  1. 2019: 1
  2. 2020: 0
  3. 2021: 4
  4. 2022: 1
  5. 2023: 1
  6. 2024: 0
  7. 2025: 0
  8. 2026: 0
  1. Sydent does not verify email server certificates this entry
    Critical · 9.3 CVE-2023-38686 < 2.5.6 2.5.6
  2. Medium · 5.9 CVE-2019-11340 < 1.0.2 1.0.2
  3. Medium · 7.7 CVE-2021-29431 < 2.3.0 2.3.0
  4. High · 7.5 CVE-2019-11842 < 1.0.3 1.0.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.