🔐Input Validation
Also known as Validation, Validating Input, Data Validation
Making sure what users send fits the rules. Then your code uses it.
Think of it like
Think of it like a bouncer checking tickets. Only the right kind of thing gets through the door.
Example
Lucy's sign-up form asks for an age. Someone sends minus 5 straight to her API, and the server answers 400 Bad Request instead of saving it.
Why it matters
Most attacks start with input the code did not expect. Checking it first stops whole kinds of bug.
Definition
Common mistake
Key takeaways
- 1Check before use. Every outside input.
- 2Allow the good. Not just block the bad.
- 3On the server. Always, every time.