Skip to content

[3.10] gh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows (GH-146591) (GH-149071) - #155440

Merged
pablogsal merged 2 commits into
python:3.10from
miss-islington:backport-7ef7dd0-3.10
Aug 10, 2026
Merged

[3.10] gh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows (GH-146591) (GH-149071)#155440
pablogsal merged 2 commits into
python:3.10from
miss-islington:backport-7ef7dd0-3.10

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

gh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows (GH-146591)

Use ZipFile.extractall() to sanitize file names and extract files.

Files with invalid names (e.g. absolute paths) are now skipped.

Files containing ".." in the name are no longer skipped.
(cherry picked from commit 7ef7dd0)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
(cherry picked from commit fc829e8)

…for ZIP files on Windows (pythonGH-146591) (pythonGH-149071)

pythongh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows (pythonGH-146591)

Use ZipFile.extractall() to sanitize file names and extract files.

Files with invalid names (e.g. absolute paths) are now skipped.

Files containing ".." in the name are no longer skipped.
(cherry picked from commit 7ef7dd0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit fc829e8)
@hugovk

hugovk commented Aug 10, 2026

Copy link
Copy Markdown
Member

Windows should pass now #153610 is merged.

@pablogsal
pablogsal merged commit 1071290 into python:3.10 Aug 10, 2026
14 of 15 checks passed
@miss-islington
miss-islington deleted the backport-7ef7dd0-3.10 branch August 10, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-security A security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants