4 ms·
> Never allow all file types for upload by default, even if it is secure in your configuration The general form - never use default-allow - should be used in m
by pdkl95 8y ago
> Never allow all file types for upload by default, even if it is secure in your configuration
The general form - never use default-allow - should be used in most situations where set of possible inputs cannot be exhaustively enumerated. In most situations, you cannot enumerate badness[1]. Instead of trying to define valid input by specifying it's inverse, it's far simpler (and safer) to use default-deny and specify valid input directly.
[1] http://www.ranum.com/security/computer_security/editorials/dumb/ http://www.ranum.com/security/computer_security/editorials/d...
- DCoder 8y agoAlso known as "use a whitelist instead of a blacklist".
- blueimp 8y agoAlthough I agree with you in a general sense, in this case there was no blacklist mistakenly used. If the server is configured to serve uploaded files securely, it is feasible to allow all file types for upload (e.g. think of Amazon S3 or Google Cloud Storage). However since there is no way to ensure that the server security settings to securely handle uploaded files are applied, limiting file uploads with a whitelist minimizes the attack vector sufficiently.