turbo
710f8424 - feat: Safely extract verified ZIP archives (#14394)

Commit
48 days ago
feat: Safely extract verified ZIP archives (#14394) ### Summary Fixes TURBO-6204. Extends #14384's shared archive boundary without adding HTTP, installation, or CLI wiring. ```text VerifiedArtifact TAR / TAR.GZ / ZIP32 (stored or DEFLATE) Bounded decoding + strict record validation Shared portable paths, layout, and node limits Owned private staging Error or drop -> Remove staging ``` - Validate ZIP local/central metadata, exact record coverage, data descriptors, decoded sizes, and CRC before writing each payload. - Reject encrypted/unsupported ZIP entries, links, special files, Windows path hazards, collisions, malformed metadata, ZIP64, and split disks. Support bounded timestamp/UID/GID extras without applying ownership or timestamps. - Preserve safe Unix executable bits and reuse cleanup-safe staging. Keep the intentionally conservative ZIP subset documented in the crate. ### Manual verification On native macOS, independently generated archives with Python's standard-library ZIP writer: eight stored/DEFLATE, seekable/streaming, and extra-field variants, plus five traversal, Windows-device, symlink, unsupported-codec, and decompression-bomb fixtures. Valid payloads, executable modes, private directories, and owned cleanup passed, including execution under `umask 0700`; malicious fixtures were rejected. Adversarial review tightened descriptor handling when the CRC equals the optional signature, extra-field validation, and reserved metadata rejection. Native Windows qualification remains outstanding; this does not claim complete platform or tool-installation support. ZIP links remain unsupported; validated relative TAR symlinks are preserved from #14393.
Author
Parents
Loading