Spring Security · interview question
Why does HTML encoding user inputs in Java web applications matter in practice?
Multiple choiceEasychapter-17-curatedpremiumspring-securityspring-security-filter-chain
Answer and explanation
Correct answer
A. To prevent stored XSS attacks
Why
HTML encoding user inputs is a technique used to prevent stored XSS attacks by converting potentially dangerous characters into their HTML entity equivalents, ensuring that user inputs are treated as text rather than executable code.
Test yourself on Spring Security
A free test with instant, explained results. No account needed.
More Spring Security questions
- What HTTP response code does Spring Security typically return for unauthorized requests?
- In a stateless JWT token, what component ensures the token's integrity and prevents tampering?
- How does Spring Security handle a request identified as a potential CSRF attack?
- Why is separating authentication from authorization important in a real system?
- What does Spring Security's Authentication Filter primarily do?
- In the context of BCrypt, what does increasing the work factor achieve?