What must an upload handler do to stop this archive entry escaping its target folder?
archive.zip contains: ../../../etc/cron.d/job
- Check the archive's file size
- Rename the zip before extracting any of it
- Verify the resolved path stays inside
- Scan the archive with antivirus
This is Zip Slip: entry names with ../ write outside the extraction directory. Canonicalise each destination path and reject any not under the target root.
Play Cybersecurity ▸