Las cargas de archivos son una función común pero un riesgo de seguridad significativo — los archivos maliciosos pueden llevar a la ejecución de código, distribución de malware o compromiso del sistema. Asegurar las cargas requiere validar tipos de archivo, tamaños y contenido, almacenar archivos de forma segura y servirlos cuidadosamente.
Los riesgos de las cargas de archivos
Allowing users to upload files is dangerous if not secured:
✗ MALICIOUS executable/script files → could run on the server (e.g. uploading a web
shell / script that gets executed → server compromise)
✗ MALWARE distribution (files served to other users)
✗ Oversized files → denial of service (disk/memory exhaustion)
✗ Path traversal in filenames (../../) → overwrite system files
✗ Files with misleading types/content (a .jpg that's actually a script)
