Multiple choice technology security

Once an input data validation flags an input as “invalid” what would be the most secure response ?

  1. Escape the invalid characters and continue processing the input data

  2. Accept the input data without modifying it and log the validation error

  3. Delete the invalid characters and continue processing the input data

  4. Reject the entire input data and send an error message back to the user

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

When input validation fails, the most secure response is to completely reject the input and return an error to the user. Options A (escape), B (accept and log), and C (delete) all continue processing potentially malicious data, which can lead to security vulnerabilities. Rejection prevents any chance of the attacker bypassing validation through edge cases or encoding tricks. Never try to fix invalid input - reject it entirely.