Skip to content
Sharp

OWASP Vulnerabilities · interview question

In a Spring Security setup, where is the best place to implement XSS protection for user-generated content?

Multiple choiceHardchapter-17-curatedpremiumowasp-vulnerabilitiescross-site-scripting-xss
Choose one answer
Answer and explanation

Correct answer

A. View layer with HTML encoding

Why

The view layer is responsible for rendering HTML content. By applying HTML encoding here, you ensure that any potentially dangerous characters are neutralized before they reach the browser.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →