การอัปโหลดไฟล์ (file uploads) เป็นฟีเจอร์ที่พบบ่อยแต่เป็นความเสี่ยงด้านความปลอดภัยที่สำคัญ ไฟล์ที่เป็นอันตรายอาจนำไปสู่การรันโค้ด การกระจายมัลแวร์ หรือการบุกรุกระบบ การรักษาความปลอดภัยของการอัปโหลดต้องการการตรวจสอบประเภทไฟล์ ขนาด และเนื้อหา การเก็บไฟล์อย่างปลอดภัย และการให้บริการไฟล์อย่างระมัดระวัง
ความเสี่ยงของการอัปโหลดไฟล์
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)
