You are developing a web application where users can submit comments. Which of the following techniques would you implement to ensure that malicious scripts aren't executed when other users view the comments?

  • Input Validation and Sanitization
  • Server-Side Rendering (SSR)
  • Using Base64 Encoding
  • Implementing Captcha Verification
Input Validation and Sanitization are key to preventing Cross-Site Scripting (XSS) attacks. These techniques ensure that user input is thoroughly checked and sanitized to prevent the execution of malicious scripts when displaying comments. SSR, Base64 encoding, and Captcha are useful in other contexts but do not directly prevent XSS.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *