Study. uk . com
  1. Home
  2. All questions
  3. Question 146

CompTIA Security+ study material · question 146 of 611

Why should input be canonicalised before it is validated?

  1. To satisfy the database's character set
  2. To allow the value to be logged safely
  3. So that two encodings of the same string are not treated differently
  4. To reduce the size of the stored value
Show the answer

Answer: C. So that two encodings of the same string are not treated differently

Without canonicalisation an attacker can encode a forbidden value so the check passes but the consumer decodes it back.

Source: OWASP Input Validation Cheat Sheet (OWASP) — OWASP Input Validation Cheat Sheet › Validation

Challenge yourself on this topic → Study as cards