← Web Application Security tutorial

Web Application Security

Input Validation & Sanitization

Every vulnerability in this subject has the same root cause: user input being trusted and used somewhere it shouldn't be. Validation rejects input that doesn't match what's expected (an email field that isn't shaped like an email, a quantity field that isn't a positive number). Sanitization goes further — it doesn't just check the input, it transforms it into a safe form (like the HTML-escaping from the XSS article).

The practical rule: validate and sanitize on the server, not just in the browser. Client-side validation is a good user-experience nicety, since it gives instant feedback, but it's trivial for an attacker to bypass entirely by sending a request directly to the server, skipping the browser and its JavaScript altogether.

Ready to go further?

These free tutorials are a preview, our Cybersecurity cohort covers it in depth, with a real project and a cohort alongside you. Closes Nov 30

Enroll in Cybersecurity

Cookie preferences

Choose what you're comfortable with. You can change this any time from the footer.

Don't miss out

Ready to build something real?

Create a free account to enroll in a track, and get notified the moment a cohort opens.

Create free account