|
|
|
|
|
by mr_puzzled
2770 days ago
|
|
Somewhat related : are there any guides/tutorials about how to do secure file uploads in webapps and how to avoid obvious security pitfalls? Reading the Django docs https://docs.djangoproject.com/en/2.1/topics/security/#user-... , specifically, >Django’s media upload handling poses some vulnerabilities when that media is served in ways that do not follow security best practices. Specifically, an HTML file can be uploaded as an image if that file contains a valid PNG header followed by malicious HTML. This file will pass verification of the library that Django uses for ImageField image processing (Pillow). When this file is subsequently displayed to a user, it may be displayed as HTML depending on the type and configuration of your web server. is a little concerning. They recommend serving images from a different domain and whitelist file types. Is that enough? Anything else needs to be done to improve security? Does handling uploads alone give attackers an RCE oppurtunity or is it safe to handle files in the server and then upload to aws s3? |
|