CVE-2021-21333
Python vulnerability analysis and mitigation

Overview

Synapse, a Matrix reference homeserver written in Python, contained a vulnerability (CVE-2021-21333) related to HTML injection in email and account expiry notifications. The vulnerability was discovered and fixed in version 1.27.0, released in February 2021 (GitHub Advisory).

Technical details

The vulnerability allowed HTML injection in two specific notification types: notification emails for missed messages and account expiry notifications. For missed messages notifications, an attacker could potentially insert forged content into the email. The account expiry feature, while also vulnerable to HTML injection, was not enabled by default and the HTML injection was not controllable by an attacker. The issue was related to improper escaping of variables in HTML templates (GitHub Advisory).

Impact

The impact of this vulnerability was considered Low severity. In the case of missed message notifications, attackers could potentially inject malicious HTML content into notification emails, potentially leading to phishing or other social engineering attacks. For account expiry notifications, the impact was limited since the feature was not enabled by default and the injection was not attacker-controllable (GitHub Advisory).

Mitigation and workarounds

The issue was fixed in Synapse version 1.27.0. For users unable to upgrade, several workarounds were available: For missed messages notifications, the notif.html, notifmail.html, and room.html templates could be overridden with custom templates that manually escape variables using Jinja2's escape filter. For account expiry notifications, administrators could either disable account expiry via the accountvalidity.enabled setting or override the notice_expiry.html template with a custom template that properly escapes variables (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-65896CRITICAL9.8
  • PythonPython
  • asyncmy
NoNoDec 02, 2025
CVE-2025-66423HIGH7.1
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-66454MEDIUM6.5
  • PythonPython
  • arcade-mcp-server
NoYesDec 02, 2025
CVE-2025-66424MEDIUM6.5
  • PythonPython
  • trytond
NoYesNov 30, 2025
CVE-2025-65858LOW3.5
  • PythonPython
  • calibreweb
NoNoDec 02, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management