Courses / Frontend Security & Observability
13. Input sanitization & XSS prevention
Techniques to prevent cross-site scripting by sanitizing or escaping user-controlled content.
JavaScript
Input sanitization & XSS prevention
Stopping attackers from injecting executable HTML or JavaScript into pages by escaping or filtering user-controlled content.
"I don't want a comment box to let someone run scripts in other users' browsers."
Sanitization and escaping convert or remove unsafe characters and markup from user input so it can't be interpreted as HTML/JS by the browser, preventing cross-site scripting (XSS).
"I don't want a comment box to let someone run scripts in other users' browsers."
Sanitization and escaping convert or remove unsafe characters and markup from user input so it can't be interpreted as HTML/JS by the browser, preventing cross-site scripting (XSS).