Why does input validation performed only in the browser (client side) give no real security?
Most application flaws come from a few avoidable mistakes. Good practices: - Validate all input on the server side (type, length, format, allowed values); never trust the client. - Use parameterised queries (prepared statements) so input is treated as data, never as SQL code. - Encode output so user-supplied content is displayed, not executed (defends against XSS). - Enforce authorisation checks on every request on the server. - Never hard-code secrets (passwords, API keys) in source code; use a secrets vault. - Handle errors without revealing internal details; log security events. - Use maintained, approved libraries and keep them updated.
Worked example
A developer replaces "SELECT * FROM clients WHERE id = " + input with a prepared statement that binds the input as a parameter. The input 1 OR 1=1 now simply finds no matching client instead of returning every record.
Exam trap: Client-side (browser) validation improves usability but provides no security, because attackers can bypass it.