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

Rejecting invalid input outright and sending an error is the most secure response because it avoids processing potentially malicious payloads. Escaping or deleting characters can result in bypasses (e.g., nested sanitization bypasses) or unintended data modification, while accepting it and merely logging is completely insecure.