Upload functionality is ubiqutuous Opens risk If user input not correctly filtered/validated it's easily exploitable
Most common reason behind file upload vulnerability is weak file validation and verification
Worst possible vuln =
- Unauthenticated arbitrary file upload
- self explanatory - any unauth user can upload any file type - 1step from RCE on backend
Various tests used to validate ext/content of uploaded files.
- if these filters aren't secure we can bypass + reach arbitrary file upload
Most common + critical attack is gaining RCE
- uploading webshell
- can be converted into an interactive shell
- uploading script that sends revshell
Some cases we do not have arbitrary file upload and we can only upload specific filetypes, but in these cases there's various attacks we can perform to exploit file uploads
- ex:
- Introducing other vulns like XSS / XXE
- Causing a DOS
- Overwriting system files and configurations
- etc..
File upload vulns are not only caused by writing insecure functions but are often caused by the use of outdated libraries that may be vulnerable to these attacks