Web Security · Middle · Question 9 of 75

Why is "sanitize on input, store the clean version" less reliable than encoding on output?

Explanation

Validate input for format, but encode at the point of output for the exact context. That works even for data that arrived through other channels.

Further reading

Problem with a question

Web Security · Middle · question 9

Test yourself

Take the Web Security · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz