What is input validation in web security?
- A.A. Checking if the user is logged in
- B.C. Encrypting input data
- C.B. Verifying that user-supplied data meets expected format, type, length, and range before processing
- D.D. Logging all user inputs
Why C is correct
Input validation checks that data conforms to expectations: correct data type, within length limits, matches expected patterns (regex for email, phone), within valid ranges, and doesn't contain dangerous characters. Validation should be server-side (client-side can be bypassed). It's a defense-in-depth measure, not a sole defense against injection.
Know someone studying for Security Fundamentals? Send them this one.