I have build an Angular 2 Project and added a search field. Now I want to test input sanity, like XSS or HTML injections for Security. How can I test it? Thanks.
Asked
Active
Viewed 442 times
1
-
As far as I am concerned you do NOT test XSS or HTML in Angular2/4 because it has built-in XSS protection (some kind of escaping).https://stackoverflow.com/questions/36594516/how-does-angular-2-handle-with-xss-or-csrf – Pijotrek Aug 23 '17 at 12:58
-
Possible duplicate of [How does Angular 2 handle with XSS or CSRF?](https://stackoverflow.com/questions/36594516/how-does-angular-2-handle-with-xss-or-csrf) – Pijotrek Aug 23 '17 at 12:59
-
What exactly you want to test? You can write your own service which do this work. And you also can test that this service is called everywhere. What exactly you want to test :) – Sharikov Vladislav Aug 23 '17 at 13:16
-
@SharikovVladislav I've got this search field which only searches for a special component. My task is 'input sanity check'. I have to provide sanity check for frontend escaping and security checking user inputs and calls to the endpoints. That means I have to check if a Javascript, SQL or HTML input doesn't affect my code. – vaman Aug 23 '17 at 13:41