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 entirely is the most secure response because it prevents any potentially malicious data from entering the system. Escaping or deleting characters might miss edge cases or introduce new vulnerabilities. Accepting invalid data without modification directly exposes the system to attack.