Sanitizing Output
Understand the importance of sanitizing all user-generated output before displaying it in your Node.js application. Learn methods to escape HTML, XML, and command-line output to prevent malicious scripts and attacks, ensuring your app is secure from common vulnerabilities.
We'll cover the following...
We'll cover the following...
Outputting to the browser
Take precautions when saving data you take in. Sanitize or escape any user-generated data that is output back to the browser.
You can modify and escape your data before saving to the database, or in between by retrieving and outputting it to the browser. This depends on how your data is edited and used. For example, if the user is editing the data later, it makes more sense to save as-is and sanitize upon output.
What security benefits come from escaping user-generated ...