9

I am developing a web application using Angular2 Beta.

My forms include simple Text fields and Text areas which accept input from the user and the data is displayed back in the application.

These fields are not meant to take any HTML input and render them back in HTML format.

I tried entering simple javascript code like

<script>alert("XSS");</script>

It is displayed as it is without running the malicious code. :)

I would like to check if my application is vulnerable to XSS attacks.

Does Angular 2+ sanitize the user inputs by default?

1 Answer 1

9

Yes it does! Angular2 provides a built-in, enabled by default, anti XSS protection named DomSanitizationService.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.