3 ms·
`extractall` does mitigate directory traversal. Looking at the source code, both `extract` and `extractall` call `_extract_member` which sanitizes the file path
by ishi 8y ago
`extractall` does mitigate directory traversal. Looking at the source code, both `extract` and `extractall` call `_extract_member` which sanitizes the file paths.
See https://github.com/python/cpython/blob/3.6/Lib/zipfile.py https://github.com/python/cpython/blob/3.6/Lib/zipfile.py
- bjpbakker 8y agoGood catch. Seems like the docs warn too much on this then, but good to see that it's not a problem in Python.
- deleted 8y ago[deleted]