What is Cross-Site Scripting (XSS)?
Cross-Site Scripting (XSS) is a security vulnerability where attackers inject malicious scripts into web pages viewed by users. XSS can steal session cookies, hijack accounts, or manipulate page content.
Types of XSS:
- Stored XSS: Malicious scripts are stored on the server and executed when users access content.
- Reflected XSS: Scripts are reflected off a web server in error messages or search results.
- DOM-Based XSS: Malicious scripts execute via client-side scripts manipulating the Document Object Model (DOM).
Prevention includes input validation, output encoding, and using security-focused frameworks.