Browser & Web Performance · Senior · Question 51 of 75

Why is it better to encode output for its context than to filter 'bad' input once on arrival?

Explanation

Validate input for business rules, but escape at the point of output using context-aware templating.

Further reading

Problem with a question

Browser & Web Performance · Senior · question 51

Test yourself

Take the Browser & Web Performance · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz