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.
Loading...
Related Quiz
- In which of the following template engines can you write plain JavaScript code inside special tags?
- How does npm handle version conflicts between dependencies and devDependencies?
- The fs.createReadStream method is particularly useful when dealing with ______ sized files.
- How can developers handle multiple callback functions to avoid "Callback Hell" in Node.js?
- To validate incoming request payloads in Express, it is recommended to use a library like ______.