Spring Security · interview question
Which approach should be used to mitigate SQL injection vulnerabilities in Java applications?
Multiple choiceHardchapter-17-curatedpremiumspring-securityspring-security-filter-chain
Answer and explanation
Correct answer
B. Using prepared statements
Why
Prepared statements are a robust way to prevent SQL injection attacks as they separate SQL logic from data, ensuring that user inputs cannot unintentionally alter query structure. This prevents attackers from injecting malicious SQL 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?