Angular prevents XSS vulnerabilities by treating all values as untrusted by default. Untrusted values are systematically sanitized by the framework before they are inserted into the DOM.
Still, developers have the ability to manually mark a value as trusted if they are sure that the value is already sanitized. Accidentally trusting malicious data will introduce an XSS vulnerability in the application and enable a wide range of serious attacks like accessing/modifying sensitive information or impersonating other users.
== Ask Yourself Whether
* The value for which sanitization has been disabled is user controlled.
* It's difficult to understand how this value is constructed.
There is a risk if you answered yes to any of those questions.
* Avoid including dynamic executable code and thus disabling Angular's built-in sanitization unless it's absolutely necessary. Try instead to rely as much as possible on static templates and Angular built-in sanitization to define web page content.
* Make sure that you choose the correct https://angular.io/api/platform-browser/DomSanitizer[DomSanitizer] "bypass" method based on the context. For instance, only use ``++bypassSecurityTrustUrl++`` to trust urls in an ``++href++`` attribute context.