In plain words
Input validation means your server checks every piece of incoming data, like a quantity, an email or a note, before it saves or acts on it.
Where you see it
QuickBite's order form only offers quantities from 1 to 10. A visitor can skip the form and send quantity: -5 straight to your API, and if the server believes it, the order total goes negative.
What goes wrong
- Validating only in the form
Browser checks help honest users fix typos. Requests can be sent without your form, so the server has to check again.
- Saving whatever fields the request contains
Passing the whole request body to an update lets someone add role: "admin" to their own profile. Pick the fields you expect and drop the rest.
await supabase.from("profiles").update(body).eq("id", user.id); - No limit on length or size
A note field with no cap lets someone save 50 MB of text and slow every page that loads it. Set a maximum for every text field.
What to tell your agent
Quick check
Sign in to earn +10 XP for itChirp's post box has maxlength="280", yet someone publishes a 20,000-character post. How?