To mitigate these risks, the project and industry leaders like the OWASP Foundation recommend several "hot" mitigation strategies:

Do not trust the Content-Type header, as it can be spoofed; instead, inspect the actual file contents to verify its type.

Large files can be used to perform Denial of Service (DoS) attacks by exhausting server storage or memory. "Hot" Strategies for Securing File Uploads

Uploaded files may contain code designed to infect the system or other users.