Web Security · Senior · Question 64 of 75

Why should file uploads be validated by content and not just by extension?

Explanation

Store files outside the web root with generated names, scan them, and never execute or serve them from your main origin.

Further reading

Problem with a question

Web Security · Senior · question 64

Test yourself

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

Take this quiz