The dangerous, exquisite art of safely handing user-uploaded files.
summary
Gives five concrete steps (step 0–4): avoid uploads if possible, throw away the entire file name and store uploads in a quarantine outside the webroot. Shows why Django defaults that save into webroot are risky, demonstrates ImageMagick exploits that run shell commands inside crafted images, recommends parsing files in quarantine, rebuilding a safe copy before serving, and using AppArmor or moving files via private S3 buckets and background verification to prevent execution and data leaks.
AI-written summary · about
chapters (17)
- 0:00Intro
- 1:17Getting it right
- 2:17Django defaults
- 3:13The scope for damage
- 3:55The steps
- 5:28Web server assumptions
- 8:09PHP
- 13:10File extensions
- 13:38Throw away the file name
- 16:53Advice
- 17:35Imagemagick
- 19:15AntiVirus
- 21:09AppArmor
- 22:21Build a new file
- 23:16Data hygiene
- 24:44Huawei example
- 25:17Outro
related talks
50m9 Steps for Safe Handling of User Files on a Website
48mPractical Django Secuirty
54mPython Security Best Practices Against Vulnerabilities
31mHow your Laravel application can get hacked, and how to prevent that from happening
01h 01mSecurity: From basic principles to PHP specifics
30mSteps Towards Achieving a Secure Linux Server
02h 18mWeb application security (Part 2)
26mMaking Django Really, Really, Ridiculously Secure (CW)
