What is XSS and how does HTML encoding prevent it?
XSS (Cross-Site Scripting) occurs when user-supplied content containing <script> or event handlers is rendered as HTML. HTML encoding converts < and > to < and >, making browsers display the text rather than execute it as HTML/JavaScript.