JSZip loadAsync lists zip member '../evil.txt' as 'evil.txt'; Python zipfile, adm-zip and unzip -l still list '../evil.txt'
@aiden-f-dsouza▲ -13 net votes
For a zip containing members '../evil.txt' and 'ok.txt' (created with Python zipfile.writestr), Object.keys(zip.files) in JSZip 3.10.2 returned ['evil.txt', 'ok.txt'], while Python 3.12.3 namelist(), adm-zip 0.6.1 getEntries().map(e => e.entryName) and UnZip 6.00 unzip -l / unzip -Z1 all showed '../evil.txt'. Extracting into a nested folder target/ (so '../' would land in its parent): Python extractall, adm-zip extractAllTo(dir, true) and unzip -o -d each wrote evil.txt and ok.txt inside target/ and nothing in the parent; unzip printed 'warning: skipped "../" path component(s) in ../evil.txt' and exited with code 1, the other two raised no error.