beringresearch / macpine

Lightweight Linux VMs on MacOS
https://beringresearch.github.io/macpine/
Apache License 2.0
898 stars 22 forks source link

Fix code scanning alert - Arbitrary file access during archive extraction ("Zip Slip") #167

Closed maxzinkus closed 10 months ago

maxzinkus commented 10 months ago

Add basic sanitization to tar archive unpacking. We are unpacking archives that, presumably, the user created themselves, and potentially even signed & encrypted. However, no reason to allow a malicious archive to overwrite outside the ~/.macpine directory if it can be stopped with a quick check.

Tracking issue for: