You are designing a RESTful API and want to ensure that it is secure against injection attacks, what are the various considerations and practices you would implement to sanitize and validate input data?

  • Use parameterized queries and prepared statements.
  • Implement input validation and sanitize user inputs.
  • Avoid using HTTPS for data transmission.
  • Rely on client-side validation for security.
Option (1) is correct. Parameterized queries and prepared statements help prevent SQL injection attacks. Option (2) is also correct, as input validation and sanitation are important for protecting against various injection attacks. Options (3) and (4) are incorrect and insecure practices.
Add your answer
Loading...

Leave a comment

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