Skip to main content

classify_entry_path

Function classify_entry_path 

Source
pub fn classify_entry_path(raw: &Path) -> EntryTarget
Expand description

Decide where an archive entry may be written.

Archive entries are attacker-controlled: an entry named ../../.bashrc or /etc/passwd would otherwise write clean outside the destination directory (the “zip slip” bug). Anything absolute, rooted, or reaching upwards is refused outright rather than clamped, so a hostile archive fails loudly instead of extracting somewhere unexpected.