Security Operations

A web form's client-side JavaScript limits a quantity field to digits. A tester bypasses it with an intercepting proxy and submits SQL syntax that the server processes. Which change addresses the root cause?

Show the answer

Correct answerD. Repeat the type and range checks on the server

AWhy not this: Output encoding applies when data is rendered and does not stop SQL syntax reaching the database query.

BWhy not this: TLS protects data in transit; the tester's malicious request would still arrive intact and be processed.

CWhy not this: Obfuscation only hides the checks; an attacker who talks to the server directly still bypasses them.

DWhy this is right: Server-side validation enforces the expected type and range regardless of what the client sends.

Client-side checks can be bypassed, so the server must validate the type, length and range of every value before using it. Output encoding protects the rendering context and does not stop SQL syntax from reaching the query.