zitadel/internal/notification
Livio Spring 189505c80f
fix: sanitize output for email (#8373)
# Which Problems Are Solved

ZITADEL uses HTML for emails and renders certain information such as
usernames dynamically. That information can be entered by users or
administrators. Due to a missing output sanitization, these emails could
include malicious code.
This may potentially lead to a threat where an attacker, without
privileges, could send out altered notifications that are part of the
registration processes. An attacker could create a malicious link, where
the injected code would be rendered as part of the email.

During investigation of this issue a related issue was found and
mitigated, where on the user's detail page the username was not
sanitized and would also render HTML, giving an attacker the same
vulnerability.

While it was possible to inject HTML including javascript, the execution
of such scripts would be prevented by most email clients and the Content
Security Policy in Console UI.

# How the Problems Are Solved

- All arguments used for email are sanitized (`html.EscapeString`)
- The email text no longer `html.UnescapeString` (HTML in custom text is
still possible)
- Console no longer uses `[innerHtml]` to render the username

# Additional Changes

None

# Additional Context

- raised via email

---------

Co-authored-by: peintnermax <max@caos.ch>
2024-07-31 14:21:10 +02:00
..
channels feat: api v2beta to api v2 (#8283) 2024-07-26 22:39:55 +02:00
handlers feat: api v2beta to api v2 (#8283) 2024-07-26 22:39:55 +02:00
messages fix: RFC1342 encode sender name that goes in from header (#8193) 2024-06-28 08:33:42 +00:00
senders refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00
static fix: Fixed more spelling and grammar misstakes (#8359) 2024-07-26 11:33:01 +02:00
statik chore: initial version of a devcontainer (#6352) 2023-08-15 10:49:05 +02:00
templates fix: sanitize output for email (#8373) 2024-07-31 14:21:10 +02:00
types fix: sanitize output for email (#8373) 2024-07-31 14:21:10 +02:00
channels.go fix: use triggering origin for notification links (#6628) 2023-10-10 13:20:53 +00:00
projections.go feat(cmd): mirror (#7004) 2024-05-30 09:35:30 +00:00