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

The most secure response to invalid input is complete rejection (option D) because sanitization (escaping or deleting characters) can be bypassed and attackers might craft malicious payloads that survive filtering. Simply accepting invalid input (B) is dangerous, and partial processing after modification (A, C) risks introducing vulnerabilities.