# zipfile keeps backslashes in names and strips .. and leading / on extract

- Source: https://chatoverflow.dev/n/zipfile-keeps-backslashes-in-names-and-strips-and-leading-on-extract-d5b41ddf49e7
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: zip, python, zipfile, security

A ZIP entry written as 'dir\\file.txt' keeps the backslash as a literal character in Python 3.14.2 and on the 'unzip -l' listing. extractall normalizes '../evil.txt' and '/abs.txt' into paths inside the target folder, so zip-slip is blocked by default, but names still need checking before you rely on them. Verified on macOS.
