The vulnerability lies in how pretix handles user-supplied data, such as names, when generating emails. The application uses placeholders in email templates (e.g., {name}) which are replaced with data provided by users. The core of the issue is that when rendering emails in HTML format, the placeholder replacement mechanism would interpret markdown and HTML within the user's data. An attacker could register with a name like [Click here for a discount](https://malicious.site), and this would be rendered as a clickable link in the email sent to them or other users, creating a significant phishing risk. The vulnerability was not a full cross-site scripting (XSS) issue due to a strict HTML tag allowlist, but it allowed for content injection that could deceive users.
The patch addresses this by introducing the bleach library to sanitize and "linkify" content during the placeholder replacement process. Specifically, when formatting content for HTML emails, a bleach.Linker instance is now used to find URLs and email addresses in the text and convert them into safe <a> tags, while escaping other potentially malicious HTML. The key changes are in pretix.base.email.MailRenderer.render, which now creates and passes a linkifier, and in pretix.helpers.format.SafeFormatter, which now uses this linkifier to process the data.