element-hq / element-hq/synapse

`bleach` dependency has been unmaintained since 2025-06-05

Open
#19,894 0 comments 0 reactions 0 assignees View on GitHub
A-Email-Push dependencies S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

Synapse relies on the bleach dependency to sanitise HTML for any email we send out:

https://github.com/element-hq/synapse/blob/5edcb0f54209b467af675931418aec2f0f1eec2d/synapse/push/mailer.py#L956-L990

It has been [marked as unmaintained](https://github.com/mozilla/bleach/issues/698) since 2025-06-05. We should find an alternative library to sanitise our HTML (and to double-check that what we're doing here is actually making a difference).

There are not currently any reported vulnerabilities with the library (v6.4.0 last month fixed three), but it's only a matter of time...

Contributor guide

Open the contributing guide

Research direction

Start with synapse/push/mailer.py lines 956-990 to understand how bleach currently sanitises HTML sent by email. Investigate maintained alternatives and verify whether the existing sanitisation changes the generated email content; done means selecting a suitable replacement and confirming the email sanitisation remains effective.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.