zitadel/console
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
..
src fix: sanitize output for email (#8373) 2024-07-31 14:21:10 +02:00
.editorconfig
.eslintrc.js
.gitignore chore(console): buf stub build (#5215) 2023-02-17 14:09:11 +00:00
.prettierignore
.prettierrc
angular.json refactor: copy only required frameworks icons from docs in console (#7538) 2024-03-11 08:33:05 +00:00
buf.gen.yaml
karma.conf.js
ngsw-config.json
package.json chore(console): upgrade dependencies (#8368) 2024-07-30 16:12:39 +02:00
prebuild.development.js
README.md
tsconfig.app.json
tsconfig.json feat(console): integrate app (#7417) 2024-02-28 16:52:21 +00:00
tsconfig.spec.json
yarn.lock chore(console): upgrade dependencies (#8368) 2024-07-30 16:12:39 +02:00

Console

This project was generated with Angular CLI version 8.3.20.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Please refer to the contributing guide

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.